/* ============================================================
   iStrology — Auth Page Styles (auth.css)
   Login / Signup — Glassmorphic dark space theme, RTL-first
   ============================================================ */

/* ── Auth Page Body ──────────────────────────────────────── */
body.page-template-page-auth {
    background: #0a0815;
    min-height: 100vh;
    overflow-x: hidden;
}

body.page-template-page-auth::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(124,58,237,0.18) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(79,70,229,0.14) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 0%, rgba(139,92,246,0.1) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* ── Auth Wrapper ────────────────────────────────────────── */
.auth-page-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
    padding: 40px 20px;
}

/* ── Auth Card ───────────────────────────────────────────── */
.auth-card {
    width: 100%;
    max-width: 440px;
    background: rgba(20, 16, 42, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(139,92,246,0.25);
    border-radius: 20px;
    padding: 44px 40px;
    box-shadow:
        0 8px 40px rgba(0,0,0,0.5),
        0 0 0 1px rgba(255,255,255,0.04) inset;
    animation: authCardIn 0.4s cubic-bezier(0.16,1,0.3,1);
}

@keyframes authCardIn {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ── Card Header ─────────────────────────────────────────── */
.auth-card__logo {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.auth-card__logo img {
    height: 32px;
    width: auto;
    filter: brightness(1.2);
}

.auth-card__title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #f0e6ff;
    margin: 0 0 4px;
    letter-spacing: -0.3px;
}

.auth-card__subtitle {
    text-align: center;
    font-size: 13px;
    color: #7c6fa0;
    margin: 0 0 28px;
}

/* ── Tab Switcher ────────────────────────────────────────── */
.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    background: rgba(10, 8, 21, 0.6);
    border: 1px solid rgba(139,92,246,0.2);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 28px;
}

.auth-tab {
    padding: 10px;
    border: none;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: #7c6fa0;
    transition: all 0.2s ease;
    font-family: inherit;
}

.auth-tab.active {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: #fff;
    box-shadow: 0 2px 10px rgba(124,58,237,0.35);
}

.auth-tab:hover:not(.active) {
    color: #c4b5fd;
    background: rgba(124,58,237,0.1);
}

/* ── Forms ───────────────────────────────────────────────── */
.auth-form {
    display: none;
    flex-direction: column;
    gap: 16px;
    animation: fadeIn 0.25s ease;
}

.auth-form.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-field label {
    font-size: 12px;
    font-weight: 600;
    color: #a78bfa;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.auth-field input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(10, 8, 21, 0.7) !important;
    border: 1px solid rgba(139,92,246,0.3) !important;
    border-radius: 9px !important;
    color: #e2e8f0 !important;
    font-size: 15px !important;
    padding: 12px 14px !important;
    font-family: inherit !important;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none !important;
}

.auth-field input:focus {
    border-color: #7c3aed !important;
    box-shadow: 0 0 0 3px rgba(124,58,237,0.2) !important;
}

.auth-field input.error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.15) !important;
}

/* ── Error Message ───────────────────────────────────────── */
.auth-error {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 8px;
    color: #fca5a5;
    font-size: 13px;
    line-height: 1.4;
    direction: rtl;
    text-align: start;
}

.auth-error.visible {
    display: flex;
    animation: fadeIn 0.2s ease;
}

/* ── Submit Button ───────────────────────────────────────── */
.auth-submit {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(124,58,237,0.4);
    transition: all 0.2s ease;
    position: relative;
    margin-top: 4px;
}

.auth-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #6d28d9, #4338ca);
    box-shadow: 0 6px 28px rgba(124,58,237,0.5);
    transform: translateY(-1px);
}

.auth-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-submit .btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto;
}

.auth-submit.loading .btn-text { display: none; }
.auth-submit.loading .btn-spinner { display: block; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Divider ─────────────────────────────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #3d3560;
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(139,92,246,0.15);
}

/* ── Footer Switch Link ──────────────────────────────────── */
.auth-switch {
    text-align: center;
    font-size: 13px;
    color: #7c6fa0;
    margin-top: 4px;
}

.auth-switch button {
    background: none;
    border: none;
    color: #a78bfa;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.auth-switch button:hover {
    color: #c4b5fd;
}

/* ── Header Auth Area ────────────────────────────────────── */
.header-user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
}

.header-user-name {
    font-family: 'Assistant', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #c4b5fd;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-user-link {
    font-family: 'Assistant', sans-serif;
    font-weight: 300;
    font-size: 18px;
    color: white;
    text-decoration: none;
    transition: color 0.2s;
    padding-inline: 4px;
}

.header-user-link:hover {
    color: #a78bfa;
}

.header-logout-btn {
    background: none;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: #fca5a5;
    font-family: 'Assistant', sans-serif;
    font-weight: 300;
    font-size: 15px;
    padding: 4px 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.header-logout-btn:hover {
    border-color: rgba(239, 68, 68, 0.6);
    color: white;
    background: rgba(239, 68, 68, 0.15);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
    .auth-card {
        padding: 32px 24px;
        border-radius: 16px;
    }
}
