/* ==========================================================
   AUTH PAGES – Login, Register, Account
   Animated Glassmorphism Design
   ========================================================== */

/* ─── Auth Wrapper ─── */
.auth {
    display: grid;
    place-items: center;
    min-height: 80vh;
    padding: 2.5rem 1.25rem 4rem;
    position: relative;
    z-index: 1;
}

/* Decorative ambient orb */
.auth::before {
    content: "";
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08), transparent 70%);
    pointer-events: none;
    z-index: -1;
    animation: float 12s ease-in-out infinite;
}

.auth__grid {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 1.5rem;
    width: min(480px, 100%);
    margin: 0 auto;
    align-items: center;
}

/* ─── Side Layout (Account page) ─── */
.auth__grid.auth__card__side {
    grid-template-columns: max-content 1fr;
    align-items: start;
    justify-items: stretch;
    width: min(900px, 100%);
}

.auth__grid.auth__card__side .auth__card {
    width: 100%;
}

.auth__grid.auth__card__side .auth__card.auth__card__side__picture {
    display: inline-grid;
    width: max-content;
    justify-self: center;
    padding: 12px;
    overflow: hidden;
    place-items: center;
}

.auth__grid.auth__card__side .auth__card.auth__card__side__picture .auth__header {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 0;
}

.auth__grid.auth__card__side .auth__card.auth__card__side__picture img {
    display: block;
    max-width: none;
    height: auto;
    border-radius: var(--radius-lg);
    transition: transform var(--transition-smooth);
}

.auth__grid.auth__card__side .auth__card.auth__card__side__picture img:hover {
    transform: scale(1.03);
}

.auth__grid.auth__card__stack {
    grid-template-columns: 1fr;
    align-items: center;
    justify-items: center;
}

/* ─── Card – Glassmorphism ─── */
.auth__card,
.auth__sideCard {
    width: min(520px, 100%);
    background: #1f2937;
    border-radius: 5px;
    box-shadow: 0 14px 34px rgba(2, 6, 23, 0.35);
    animation: fadeInUp 0.5s ease both;
    transition: border-color var(--transition-smooth),
                box-shadow var(--transition-smooth);
}

.auth__card:hover {
    border-color: var(--border-default);
    box-shadow: var(--shadow-md), var(--shadow-glow-blue);
}

/* Stagger cards */
.auth__grid .auth__card:nth-child(1) { animation-delay: 0s; }
.auth__grid .auth__card:nth-child(2) { animation-delay: 0.08s; }
.auth__grid .auth__card:nth-child(3) { animation-delay: 0.16s; }
.auth__grid .auth__card:nth-child(4) { animation-delay: 0.24s; }

.auth__card {
    padding: 22px;
}

/* ─── Card Header ─── */
.auth__header {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 14px;
    row-gap: 2px;
    align-items: center;
    margin-bottom: 1rem;
}

.auth__logo {
    display: block;
    width: 140px;
    height: auto;
    grid-row: span 2;
}

.auth__title {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth__subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.4;
}

/* ─── Alerts – Animated ─── */
.auth__alert__error {
    margin: 12px 0 14px;
    color: #ffffff;
    background: #d92d20;
    border-radius: 5px;
    padding: 10px 12px;
    box-shadow: 0 8px 18px rgba(217, 45, 32, 0.18);
}

.auth__alert__sucess {
    margin: 12px 0 14px;
    color: #ffffff;
    background: #558346;
    border-radius: 5px;
    padding: 10px 12px;
    box-shadow: 0 8px 18px rgba(72, 142, 62, 0.18);
}

.auth__alert {
    margin: 0.75rem 0 1rem;
    color: var(--text-invert);
    background: linear-gradient(135deg, var(--color-danger), #dc2626);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
    animation: scaleIn 0.3s ease;
}

.auth__alert ul {
    margin: 0;
    padding-left: 1.25rem;
}

.auth__alert li {
    margin: 0.25rem 0;
}

.auth__error {
    margin: 0.75rem 0;
    color: var(--color-danger);
    background: var(--color-danger-soft);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
    animation: scaleIn 0.3s ease;
}

/* ─── Form ─── */
.auth__form {
    margin-top: 0.5rem;
}

.auth__field {
    margin-top: 1rem;
}

.auth__search {
    margin-top: 1px;
}

.auth__field label {
    display: block;
    margin: 0 0 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--transition-normal);
}

.auth__field:focus-within label {
    color: var(--color-primary);
}

.auth__field input[type="text"],
.auth__field input[type="password"],
.auth__field input[type="email"],
.auth__field input[type="file"] {
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: #1e2537;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.9rem;
    outline: none;
    transition: all var(--transition-smooth);
}

.auth__field input[type="text"]:focus,
.auth__field input[type="password"]:focus,
.auth__field input[type="email"]:focus,
.auth__field input[type="file"]:focus {
    border-color: rgba(37, 99, 235, 0.75);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.28);
}

.auth__field input[type="text"]::placeholder,
.auth__field input[type="password"]::placeholder,
.auth__field input[type="email"]::placeholder {
    color: var(--text-muted);
}

.auth__field input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 10px 12px;
    border: 0;
    border-radius: 5px;
    background: #274a97;
    color: #ffffff;
    font-weight: 750;
    cursor: pointer;
    transition: transform 120ms ease, filter 120ms ease;
}

.auth__field input[type="file"]::file-selector-button:hover {
    filter: brightness(1.02);
    transform: translateY(-1px);
}

.auth__field input[type="file"]::file-selector-button:active {
    transform: translateY(0px);
}

/* ─── Actions ─── */
.auth__actions {
    margin-top: 14px;
}

.auth__submit {
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-radius: 5px;
    background: #274a97;
    color: #ffffff;
    font-weight: 750;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: 0.2s ease;
}

.auth__submit:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.auth__submit:active {
    transform: translateY(0px);
}

.auth__submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth__submit:disabled::before {
    display: none;
}

/* Danger button variant */
.auth__submit--danger {
    background: #d92d20;
}

/* ─── Links ─── */
.auth__links {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #5e6075;
}

.auth__muted {
    margin: 8px 0 0;
    color: #ffffff;
}

.auth__muted a {
    color: #3c5fb6;
    text-decoration: none;
    font-weight: 700;
}

.auth__muted a:hover {
    text-decoration: underline;
}

/* ─── Side Card ─── */
.auth__sideCard {
    padding: 18px;
    background: #1f2937;
}

.auth__sideCard h3 {
    margin: 0 0 10px;
    font-size: 1.05rem;
    color: #ffffff;
}

.auth__sideCard ul {
    margin: 0;
    padding-left: 18px;
    color: #ffffff;
}

.auth__sideCard li {
    margin: 8px 0;
    color: #ffffff;
}

/* ─── Tip Box ─── */
.auth__tip {
    margin-top: 14px;
    padding: 12px;
    border-radius: 5px;
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.16);
    color: #ffffff;
}

/* ==========================================================
   ACCOUNT PAGE – Profile + Settings Layout
   ========================================================== */

/* ─── Main Grid ─── */
.account {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    width: min(960px, 100%);
    margin: 0 auto;
    align-items: start;
}

/* Toast spans full width */
.account__toast {
    grid-column: 1 / -1;
}

/* ─── Profile Sidebar ─── */
.account__profile {
    position: sticky;
    top: 5rem;
    text-align: center;
    padding: 2rem 1.5rem !important;
}

.account__avatar-wrapper {
    width: 140px;
    height: 140px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--border-default);
    box-shadow: 0 0 30px rgba(37, 99, 235, 0.1);
    transition: all var(--transition-smooth);
}

.account__avatar-wrapper:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 40px rgba(37, 99, 235, 0.2);
    transform: scale(1.03);
}

.account__avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.account__displayname {
    margin: 0 0 1.25rem;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #ffffff;
}

/* ─── Detail Rows (User info) ─── */
.account__details {
    margin: 0;
    text-align: left;
}

.account__detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0;
    border-top: 1px solid var(--border-subtle);
}

.account__detail-row:last-child {
    border-bottom: 1px solid var(--border-subtle);
}

.account__detail-row dt {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.account__detail-row dd {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ─── Settings Column ─── */
.account__settings {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ─── Section Cards ─── */
.account__section {
    padding: 1.5rem !important;
}

.account__section-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.account__section-title svg {
    color: var(--color-primary);
    flex-shrink: 0;
}

.account__section-title--danger svg {
    color: var(--color-danger);
}

/* ─── Quick Actions ─── */
.account__quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.account__action-link {
    display: block;
    text-align: center;
    text-decoration: none !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
}

.account__action-link--secondary {
    background: #22c55e !important;
}

.account__action-link--secondary:hover {
    opacity: 0.9;
}

/* ─── Danger Section ─── */
.account__section--danger {
    border-color: rgba(217, 45, 32, 0.15);
}

.account__section--danger:hover {
    border-color: rgba(239, 68, 68, 0.2);
    box-shadow: var(--shadow-md), 0 0 40px rgba(239, 68, 68, 0.08);
}

.account__danger-text {
    margin: 0 0 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 900px) {
    .auth {
        padding: 1.5rem 1rem 3rem;
        min-height: auto;
    }

    .auth__grid {
        width: min(480px, 100%);
    }

    .auth__grid.auth__card__side {
        grid-template-columns: 1fr;
        justify-items: center;
        width: min(480px, 100%);
    }

    .auth__grid.auth__card__side .auth__card {
        width: 100%;
    }

    .auth__grid.auth__card__side .auth__card.auth__card__side__picture {
        width: 100%;
        justify-self: stretch;
    }

    .auth__grid.auth__card__side .auth__card.auth__card__side__picture img {
        max-width: 100%;
        width: auto;
        max-height: 200px;
        margin: 0 auto;
        display: block;
    }

    .auth__logo {
        width: 120px;
    }

    .auth__sideCard {
        display: none;
    }

    /* Account page responsive */
    .account {
        grid-template-columns: 1fr;
        width: min(520px, 100%);
    }

    .account__profile {
        position: static;
    }

    .account__avatar-wrapper {
        width: 110px;
        height: 110px;
    }
}

@media (max-width: 520px) {
    .auth {
        padding: 1rem 0.75rem 2rem;
    }

    .auth::before {
        width: 250px;
        height: 250px;
    }

    .auth__card {
        padding: 1.25rem;
        border-radius: var(--radius-md);
    }

    .auth__header {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .auth__logo {
        width: 120px;
        grid-row: auto;
        margin-bottom: 0.5rem;
    }

    .auth__title {
        font-size: 1.2rem;
    }

    .auth__subtitle {
        font-size: 0.88rem;
    }

    .auth__field input[type="text"],
    .auth__field input[type="password"],
    .auth__field input[type="email"],
    .auth__field input[type="file"] {
        padding: 0.7rem 0.8rem;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .auth__submit {
        padding: 0.85rem 1rem;
        font-size: 0.95rem;
        min-height: 48px;
    }

    .auth__muted {
        font-size: 0.82rem;
    }
}

@media (max-width: 380px) {
    .auth {
        padding: 0.75rem 0.5rem 1.5rem;
    }

    .auth__card {
        padding: 1rem;
    }

    .auth__logo {
        width: 100px;
    }

    .auth__title {
        font-size: 1.1rem;
    }

    .auth__grid.auth__card__side .auth__card.auth__card__side__picture img {
        max-height: 160px;
    }
}
