.modal-container {
    text-align: center;
}

.modal-header {
    margin-bottom: 40px;
}

.modal-header h1 {
    font-size: 3rem;
    font-weight: bold;
    color: white;
    margin-bottom: 16px;
}

.modal-header p {
    color: #c7d2fe;
    font-size: 1.125rem;
}

.modal-main-button {
    background: white;
    color: #1e1b4b;
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 1.125rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.modal-main-button:hover {
    transform: scale(1.05);
    box-shadow: 0 25px 50px -12px rgba(99, 102, 241, 0.5);
}

.modal-selected-province {
    margin-top: 32px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 24px;
    color: white;
    display: none;
}

.modal-selected-province.show {
    display: block;
}

.modal-selected-province .modal-label {
    font-size: 0.875rem;
    color: #c7d2fe;
    margin-bottom: 8px;
}

.modal-selected-province .modal-value {
    font-size: 1.5rem;
    font-weight: bold;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(20, 25, 70, 0.6) 0%, rgba(50, 20, 100, 0.5) 50%, rgba(10, 40, 120, 0.4) 100%);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-modal {
    background: linear-gradient(135deg, rgba(20, 25, 70, 0.6) 0%, rgba(50, 20, 100, 0.5) 50%, rgba(10, 40, 120, 0.4) 100%);
    backdrop-filter: blur(8px);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    max-width: 672px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    border: 2px solid rgba(129, 140, 248, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
}

.modal-modal-header {
    background: linear-gradient(90deg, #4f46e5 0%, #9333ea 50%, #4338ca 100%);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    /* اطمینان از عدم کوچک شدن هدر */
}

.modal-modal-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.05);
}

.modal-modal-header h2 {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-close-button {
    color: white;
    background: transparent;
    border: none;
    padding: 8px;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    z-index: 10;
    transition: all 0.3s ease;
}

.modal-close-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    /* بدنه فضای باقی‌مانده را بگیرد و اسکرول شود */
    background: linear-gradient(180deg, rgba(30, 27, 75, 0.5) 0%, rgba(88, 28, 135, 0.5) 100%);
}

.modal-provinces-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.modal-province-button {
    padding: 12px;
    border-radius: 12px;
    border: 2px solid rgba(129, 140, 248, 0.3);
    background: rgba(30, 58, 138, 0.3);
    backdrop-filter: blur(4px);
    color: #c7d2fe;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    transform: scale(0.9);
    text-align: right;
}

.modal-province-button:hover {
    border-color: rgba(168, 85, 247, 0.6);
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(79, 70, 229, 0.2) 100%);
    transform: scale(0.95);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-province-button.selected {
    border-color: #a855f7;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.3) 0%, rgba(79, 70, 229, 0.3) 100%);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(168, 85, 247, 0.5);
    transform: scale(0.95);
}

.modal-modal-footer {
    background: #0b1c3d;
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    z-index: 20;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    flex-shrink: 0;
    /* اطمینان از عدم کوچک شدن فوتر */
}

.modal-submit-button {
    padding: 12px 32px;
    border-radius: 12px;
    font-weight: bold;
    color: white;
    border: 2px solid rgba(168, 85, 247, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-submit-button.enabled {
    background: linear-gradient(90deg, #a855f7 0%, #4f46e5 100%);
}

.modal-submit-button.enabled:hover {
    box-shadow: 0 20px 25px -5px rgba(168, 85, 247, 0.5);
    transform: scale(1.05);
}

.modal-submit-button.disabled {
    background: rgba(75, 85, 99, 0.5);
    border-color: rgba(75, 85, 99, 0.3);
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .modal-header h1 {
        font-size: 2rem;
    }

    .modal-provinces-grid {
        grid-template-columns: 1fr;
    }
}

.modal-icon {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
}