/* =====================================================
   Tutorial Studio
   Account Modal
===================================================== */

.account-modal[hidden] {
    display: none !important;
}

.account-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: inherit;
}

.account-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgb(15 23 42 / 42%);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.account-modal-card {
    position: relative;
    width: min(100%, 410px);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 34px;
    background: #ffffff;
    border: 1px solid rgb(226 232 240 / 85%);
    border-radius: 18px;
    box-shadow: 0 24px 80px rgb(15 23 42 / 22%);
    animation: account-modal-enter 0.2s ease-out;
}

.account-modal-close {
    position: absolute;
    top: 15px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #94a3b8;
    background: transparent;
    border: 0;
    border-radius: 8px;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.account-modal-close:hover {
    color: #334155;
    background: #f1f5f9;
}

.account-modal-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1e293b;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.account-modal-brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: white;
    background: linear-gradient(135deg, #818cf8, #4f46e5);
    border-radius: 10px;
    font-size: 17px;
    font-weight: 750;
}

.account-modal-heading {
    margin: 30px 0 25px;
}

.account-modal-heading h2 {
    margin: 0;
    color: #111827;
    font-size: 25px;
    font-weight: 750;
    letter-spacing: -0.8px;
}

.account-modal-heading p {
    margin: 9px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.7;
}

.account-form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.account-form-field label {
    color: #334155;
    font-size: 13px;
    font-weight: 600;
}

.account-form-field input {
    width: 100%;
    min-height: 44px;
    padding: 0 13px;
    color: #111827;
    background: #ffffff;
    border: 1px solid #dbe2ea;
    border-radius: 9px;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.account-form-field input::placeholder {
    color: #9ca3af;
}

.account-form-field input:hover {
    border-color: #cbd5e1;
}

.account-form-field input:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgb(99 102 241 / 12%);
}

.account-form-field[hidden],
#accountModalSwitch[hidden],
#accountForgotPassword[hidden] {
    display: none !important;
}

.account-email-code-row {
    display: flex;
    gap: 8px;
}

.account-email-code-row input {
    min-width: 0;
    flex: 1;
}

.account-email-code-button {
    flex: 0 0 auto;
    padding: 0 12px;
    color: #4f46e5;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 9px;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}

.account-email-code-button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.account-forgot-password {
    display: block;
    margin: -5px 0 5px auto;
    padding: 2px 0;
    color: #4f46e5;
    background: transparent;
    border: 0;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
}

.account-forgot-password:hover {
    color: #3730a3;
    text-decoration: underline;
}

.account-form-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 45px;
    margin-top: 7px;
    color: #ffffff;
    background: #6366f1;
    border: 1px solid #6366f1;
    border-radius: 9px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
    transition:
        background-color 0.18s ease,
        box-shadow 0.18s ease;
}

.account-form-submit:hover {
    background: #4f46e5;
    box-shadow: 0 4px 12px rgb(79 70 229 / 20%);
}

.account-form-message {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.7;
}

.account-form-message[data-type="info"] {
    color: #4338ca;
    background: #eef2ff;
}

.account-form-message[data-type="error"] {
    color: #b91c1c;
    background: #fef2f2;
}

.account-modal-switch {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 22px;
    color: #64748b;
    font-size: 12px;
}

.account-modal-switch button {
    padding: 3px;
    color: #4f46e5;
    background: transparent;
    border: 0;
    font-family: inherit;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}

.account-modal-switch button:hover {
    color: #3730a3;
    text-decoration: underline;
}

.account-modal-footer {
    margin-top: 25px;
    padding-top: 17px;
    border-top: 1px solid #f1f5f9;
    color: #94a3b8;
    font-size: 11px;
    text-align: center;
}

body.account-modal-open {
    overflow: hidden;
}

@keyframes account-modal-enter {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.99);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 480px) {
    .account-modal {
        padding: 16px;
    }

    .account-modal-card {
        padding: 27px 22px;
        border-radius: 15px;
    }

    .account-modal-heading {
        margin-top: 25px;
    }

    .account-modal-heading h2 {
        font-size: 23px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .account-modal-card {
        animation: none;
    }
}