/* ========================================
   SMS OVĚŘOVACÍ MODÁL
   MOBILE FIRST + BEM
   ======================================== */

/* ---- Overlay (tmavé pozadí přes celou stránku) ---- */
.sms-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sms-modal--hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Když je hidden a zároveň display:none (skrytí pro demo), display vyhrává */
.sms-modal[hidden] {
    display: none;
}

/* ---- Karta uvnitř ---- */
.sms-modal__card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background-color: #ffffff;
    border-radius: 20px;
    padding: 32px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(1);
    transition: transform 0.3s ease;
    text-align: center;
}

.sms-modal--hidden .sms-modal__card {
    transform: scale(0.95);
}

/* ---- Ikona telefonu (kruh s gradientem) ---- */
.sms-modal__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-radius: 50%;
    color: #ffffff;
}

.sms-modal__icon svg {
    width: 30px;
    height: 30px;
}

/* ---- Nadpis ---- */
.sms-modal__title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 12px 0;
}

/* ---- Podtitulek ---- */
.sms-modal__subtitle {
    font-size: 14px;
    line-height: 1.5;
    color: #6b7280;
    margin: 0 0 24px 0;
}

.sms-modal__phone {
    color: #1f2937;
    font-weight: 600;
    white-space: nowrap;
}

/* ---- Formulář ---- */
.sms-modal__form {
    margin-bottom: 16px;
}

/* ---- 6 políček pro číslice ---- */
.sms-modal__code {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.sms-modal__digit {
    width: 44px;
    height: 52px;
    font-size: 22px;
    font-weight: 700;
    font-family: inherit;
    text-align: center;
    color: #1f2937;
    background-color: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    outline: none;
    transition: all 0.2s ease;
    -moz-appearance: textfield;
}

.sms-modal__digit::-webkit-outer-spin-button,
.sms-modal__digit::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sms-modal__digit:focus {
    border-color: #8b5cf6;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.sms-modal__digit--filled {
    border-color: #8b5cf6;
    background-color: #ffffff;
}

.sms-modal__digit--error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

/* ---- Chyba ---- */
.sms-modal__error {
    display: none;
    font-size: 13px;
    color: #ef4444;
    margin: 0 0 16px 0;
    text-align: center;
}

.sms-modal__error--visible {
    display: block;
}

/* ---- Tlačítko odeslat ---- */
.sms-modal__submit {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sms-modal__submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.sms-modal__submit:active:not(:disabled) {
    transform: translateY(0);
}

.sms-modal__submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ---- Poslat znovu ---- */
.sms-modal__resend {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.sms-modal__resend-link {
    color: #8b5cf6;
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.sms-modal__resend-link:hover {
    color: #7c3aed;
}

.sms-modal__resend-link:disabled {
    color: #9ca3af;
    cursor: not-allowed;
    text-decoration: none;
}

.sms-modal__resend-timer {
    color: #9ca3af;
    font-size: 12px;
    margin-left: 4px;
}

/* ========================================
   TABLET (768px+)
   ======================================== */

@media (min-width: 768px) {
    .sms-modal__card {
        padding: 40px 36px;
        border-radius: 24px;
    }

    .sms-modal__title {
        font-size: 24px;
    }

    .sms-modal__subtitle {
        font-size: 15px;
    }

    .sms-modal__digit {
        width: 52px;
        height: 60px;
        font-size: 26px;
    }
}
