/* ========================================
   EMAIL CONFIRMATION OVERLAY
   Shown after registration when email confirmation is pending.
   Padrão Kavo: padrao-criacoes-kavo.md
   ======================================== */

.kavo-email-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #f7f8fa;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 24px;
    text-align: center;
    font-family: 'Manrope', 'Poppins', sans-serif;
}

.kavo-email-overlay.active {
    display: flex;
    animation: kavo-overlay-in 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes kavo-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.kavo-email-overlay__card {
    max-width: 420px;
    width: 100%;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 1.75rem 1.75rem 1.5rem;
    box-shadow: none;
    animation: kavo-card-in 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes kavo-card-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Animated envelope icon */
.kavo-email-overlay__icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: #f7f8fa;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: kavo-email-pulse 2.5s ease-in-out infinite;
}

.kavo-email-overlay__icon i {
    font-size: 1.75rem;
    color: #111111;
}

@keyframes kavo-email-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(17, 17, 17, 0.06); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 14px rgba(17, 17, 17, 0); }
}

.kavo-email-overlay__title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin: 0 0 8px;
}

.kavo-email-overlay__text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    margin: 0 0 4px;
    line-height: 1.5;
}

.kavo-email-overlay__email {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    word-break: break-all;
    margin: 0 0 16px;
}

/* OTP 6-digit inputs */
.kavo-otp-inputs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 4px 0 8px;
}

.kavo-otp-digit {
    width: 46px;
    height: 54px;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    background: #f9fafb;
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease;
    font-family: 'Manrope', 'Poppins', monospace;
    caret-color: #111111;
}

.kavo-otp-digit:focus {
    border-color: #111111;
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
    background: #ffffff;
}

.kavo-otp-digit:not(:placeholder-shown) {
    background: #ffffff;
    border-color: #111111;
}

/* OTP error message */
.kavo-otp-error {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ef4444;
    margin: 4px 0 8px;
    min-height: 20px;
}

/* OTP verify button */
.kavo-otp-verify {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 24px;
    margin-top: 4px;
    background: #111111;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 180ms ease, opacity 180ms ease;
}

.kavo-otp-verify:hover {
    background: #000000;
}

.kavo-otp-verify:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.kavo-otp-verify .spinner-border {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.kavo-email-overlay__hint {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    font-size: 0.78rem;
    font-weight: 500;
    color: #9ca3af;
    line-height: 1.5;
}

.kavo-email-overlay__hint a {
    color: #111111;
    text-decoration: underline;
    cursor: pointer;
    transition: color 180ms ease;
}

.kavo-email-overlay__hint a:hover {
    color: #000000;
}

/* Success state */
.kavo-email-overlay--success .kavo-email-overlay__icon {
    background: #ecfdf5;
    border-color: #d1fae5;
    animation: none;
}

.kavo-email-overlay--success .kavo-email-overlay__icon i {
    color: #10b981;
}

/* ========================================
   RESPONSIVE — Mobile < 576px
   ======================================== */
@media (max-width: 575.98px) {
    .kavo-email-overlay {
        padding: max(14px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
    }
    .kavo-email-overlay__card {
        width: min(100%, calc(100vw - 24px));
        max-width: 380px;
        margin-inline: auto;
        padding: 1.25rem 1rem 1rem;
        border-radius: 16px;
    }
    .kavo-email-overlay__icon {
        width: 64px;
        height: 64px;
        margin-bottom: 16px;
    }
    .kavo-email-overlay__icon i {
        font-size: 1.5rem;
    }
    .kavo-email-overlay__title {
        font-size: 1.15rem;
    }
    .kavo-otp-inputs {
        gap: 6px;
    }
    .kavo-otp-digit {
        width: 42px;
        height: 50px;
        font-size: 1.3rem;
        border-radius: 10px;
    }
}

/* ========================================
   RESPONSIVE — Small mobile < 400px
   ======================================== */
@media (max-width: 399.98px) {
    .kavo-email-overlay__card {
        width: min(100%, calc(100vw - 16px));
        max-width: 360px;
        padding: 1rem 0.875rem 1rem;
    }
    .kavo-email-overlay__title {
        font-size: 1.05rem;
    }
    .kavo-email-overlay__text {
        font-size: 0.82rem;
    }
    .kavo-otp-inputs {
        gap: 5px;
    }
    .kavo-otp-digit {
        width: 38px;
        height: 46px;
        font-size: 1.15rem;
        border-radius: 8px;
    }
}

/* Spinner utility */
.kavo-spin {
    animation: spin 0.8s linear infinite;
}

/* ========================================
   CALLBACK MODAL — Confirmação de email (global handler)
   Modal centralizado fullscreen, padrão Kavo
   ======================================== */
.kavo-email-toast {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #f7f8fa;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 24px;
    text-align: center;
    font-family: 'Manrope', 'Poppins', sans-serif;
}

.kavo-email-toast.show {
    display: flex;
    animation: kavo-overlay-in 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

.kavo-email-toast__card {
    max-width: 420px;
    width: 100%;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 1.75rem 1.75rem 1.5rem;
    box-shadow: none;
    animation: kavo-card-in 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

.kavo-email-toast__icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: #f7f8fa;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kavo-email-toast__icon i {
    font-size: 1.75rem;
    color: #111111;
}

.kavo-email-toast__text {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin: 0 0 8px;
}

.kavo-email-toast__sub {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}

.kavo-email-toast__spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    color: #9ca3af;
    font-size: 0.8rem;
    font-weight: 500;
}

.kavo-email-toast__spinner .spinner-border {
    width: 16px;
    height: 16px;
    border-width: 2px;
    color: #111111;
}

/* Success state */
.kavo-email-toast--success .kavo-email-toast__icon {
    background: #ecfdf5;
    border-color: #d1fae5;
}

.kavo-email-toast--success .kavo-email-toast__icon i {
    color: #10b981;
}

/* Error state */
.kavo-email-toast--error .kavo-email-toast__icon {
    background: #fef2f2;
    border-color: #fecaca;
}

.kavo-email-toast--error .kavo-email-toast__icon i {
    color: #ef4444;
}

/* ========================================
   RESPONSIVE callback modal — Mobile < 576px
   ======================================== */
@media (max-width: 575.98px) {
    .kavo-email-toast {
        padding: max(14px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
    }
    .kavo-email-toast__card {
        width: min(100%, calc(100vw - 24px));
        max-width: 380px;
        margin-inline: auto;
        padding: 1.25rem 1rem 1rem;
        border-radius: 16px;
    }
    .kavo-email-toast__icon {
        width: 64px;
        height: 64px;
        margin-bottom: 16px;
    }
    .kavo-email-toast__icon i {
        font-size: 1.5rem;
    }
    .kavo-email-toast__text {
        font-size: 1.15rem;
    }
}

/* ========================================
   RESPONSIVE callback modal — Small mobile < 400px
   ======================================== */
@media (max-width: 399.98px) {
    .kavo-email-toast__card {
        width: min(100%, calc(100vw - 16px));
        max-width: 360px;
        padding: 1rem 0.875rem 1rem;
    }
    .kavo-email-toast__text {
        font-size: 1.05rem;
    }
    .kavo-email-toast__sub {
        font-size: 0.82rem;
    }
}
