/* ============================================
   BYAM Auth Pages — Modern Design System
   ============================================ */

:root {
    --auth-primary: #7c3aed;
    --auth-primary-light: #a78bfa;
    --auth-primary-dark: #5b21b6;
    --auth-accent: #06b6d4;
    --auth-accent-light: #22d3ee;
    --auth-success: #10b981;
    --auth-warning: #f59e0b;
    --auth-danger: #ef4444;
    --auth-bg-start: #0f0c29;
    --auth-bg-mid: #302b63;
    --auth-bg-end: #24243e;
    --auth-glass: rgba(255, 255, 255, 0.06);
    --auth-glass-border: rgba(255, 255, 255, 0.12);
    --auth-glass-hover: rgba(255, 255, 255, 0.1);
    --auth-text: #f1f5f9;
    --auth-text-muted: rgba(255, 255, 255, 0.55);
    --auth-text-label: rgba(255, 255, 255, 0.72);
    --auth-radius: 16px;
    --auth-radius-sm: 10px;
    --auth-radius-full: 50px;
    --auth-transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* — Layout — */
body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--auth-bg-start) 0%, var(--auth-bg-mid) 50%, var(--auth-bg-end) 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* Hide default header/footer on auth pages */
body > header,
body > footer { display: none; }

.auth-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* — Animated background particles — */
.auth-bg-particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.auth-bg-particles span {
    position: absolute;
    border-radius: 50%;
    background: rgba(124, 58, 237, 0.15);
    animation: authFloat linear infinite;
}

.auth-bg-particles span:nth-child(1)  { width: 80px; height: 80px; left: 10%; animation-duration: 25s; animation-delay: 0s; }
.auth-bg-particles span:nth-child(2)  { width: 40px; height: 40px; left: 25%; animation-duration: 20s; animation-delay: 2s; background: rgba(6, 182, 212, 0.12); }
.auth-bg-particles span:nth-child(3)  { width: 120px; height: 120px; left: 55%; animation-duration: 30s; animation-delay: 4s; }
.auth-bg-particles span:nth-child(4)  { width: 60px; height: 60px; left: 75%; animation-duration: 22s; animation-delay: 1s; background: rgba(6, 182, 212, 0.1); }
.auth-bg-particles span:nth-child(5)  { width: 30px; height: 30px; left: 90%; animation-duration: 18s; animation-delay: 3s; }
.auth-bg-particles span:nth-child(6)  { width: 100px; height: 100px; left: 40%; animation-duration: 28s; animation-delay: 5s; background: rgba(167, 139, 250, 0.1); }

@keyframes authFloat {
    0%   { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(-120vh) rotate(720deg); opacity: 0; }
}

/* — Brand Side (left panel) — */
.auth-brand {
    flex: 0 0 42%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 48px;
    position: relative;
    z-index: 1;
    text-align: center;
}

.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(124, 58, 237, 0.25) 0%, rgba(6, 182, 212, 0.15) 100%);
    backdrop-filter: blur(60px);
    -webkit-backdrop-filter: blur(60px);
    z-index: -1;
}

.auth-brand-logo {
    width: 90px;
    height: 90px;
    border-radius: 24px;
    object-fit: contain;
    margin-bottom: 28px;
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.3);
    background: rgba(255,255,255,0.1);
    padding: 12px;
}

.auth-brand h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px 0;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.auth-brand h1 span {
    background: linear-gradient(135deg, var(--auth-accent-light), var(--auth-primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-brand p {
    color: var(--auth-text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 340px;
    margin: 0 auto 36px;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 18px;
    text-align: left;
    width: 100%;
    max-width: 320px;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--auth-glass);
    border: 1px solid var(--auth-glass-border);
    border-radius: var(--auth-radius-sm);
    transition: var(--auth-transition);
}

.auth-feature:hover {
    background: var(--auth-glass-hover);
    transform: translateX(4px);
}

.auth-feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.auth-feature-icon.purple { background: rgba(124, 58, 237, 0.2); color: var(--auth-primary-light); }
.auth-feature-icon.cyan   { background: rgba(6, 182, 212, 0.2); color: var(--auth-accent-light); }
.auth-feature-icon.green  { background: rgba(16, 185, 129, 0.2); color: #34d399; }

.auth-feature span {
    color: var(--auth-text);
    font-size: 0.92rem;
    font-weight: 500;
}

/* — Form Side (right panel) — */
.auth-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    z-index: 1;
}

/* — Glass Card — */
.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--auth-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--auth-glass-border);
    border-radius: var(--auth-radius);
    padding: 40px 36px;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--auth-primary), var(--auth-accent));
    border-radius: var(--auth-radius) var(--auth-radius) 0 0;
}

/* — Tabs — */
.auth-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: var(--auth-radius-full);
    margin-bottom: 32px;
    position: relative;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 12px 20px;
    color: var(--auth-text-muted);
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    border: none;
    background: transparent;
    border-radius: var(--auth-radius-full);
    transition: var(--auth-transition);
    position: relative;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-tab:hover {
    color: var(--auth-text);
}

.auth-tab.active {
    color: #fff;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.35);
}

/* — Form panels — */
.auth-panel {
    display: none;
    animation: authFadeSlideIn 0.4s ease forwards;
}

.auth-panel.active {
    display: block;
}

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

/* — Title — */
.auth-title {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--auth-text);
    margin: 0 0 6px 0;
}

.auth-subtitle {
    color: var(--auth-text-muted);
    font-size: 0.9rem;
    margin: 0 0 28px 0;
}

/* — Form groups — */
.auth-form-group {
    margin-bottom: 22px;
    position: relative;
}

.auth-form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--auth-text-label);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 16px;
    color: var(--auth-text-muted);
    font-size: 1.1rem;
    transition: color var(--auth-transition);
    pointer-events: none;
    z-index: 1;
}

.auth-input {
    width: 100%;
    padding: 14px 16px 14px 46px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--auth-radius-sm);
    color: var(--auth-text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--auth-transition);
    outline: none;
}

.auth-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.auth-input:focus {
    border-color: var(--auth-primary-light);
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.auth-input:focus ~ .auth-input-icon {
    color: var(--auth-primary-light);
}

/* Password toggle */
.auth-pw-toggle {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--auth-text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--auth-transition);
    z-index: 1;
}

.auth-pw-toggle:hover {
    color: var(--auth-text);
}

/* — Remember / links row — */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

/* Custom toggle switch */
.auth-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.auth-switch input {
    display: none;
}

.auth-switch-track {
    width: 42px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    position: relative;
    transition: var(--auth-transition);
}

.auth-switch-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    transition: var(--auth-transition);
}

.auth-switch input:checked + .auth-switch-track {
    background: var(--auth-primary);
}

.auth-switch input:checked + .auth-switch-track::after {
    left: 21px;
    background: #fff;
}

.auth-switch-label {
    color: var(--auth-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.auth-link {
    color: var(--auth-primary-light);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--auth-transition);
}

.auth-link:hover {
    color: var(--auth-accent-light);
    text-decoration: underline;
}

/* — Main CTA button — */
.auth-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: var(--auth-radius-sm);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: var(--auth-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.auth-btn-primary {
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
    color: #fff;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
}

.auth-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.5);
}

.auth-btn-primary:active {
    transform: translateY(0);
}

/* Button loading state */
.auth-btn.loading {
    pointer-events: none;
    opacity: 0.85;
}

.auth-btn.loading .auth-btn-text {
    visibility: hidden;
}

.auth-btn.loading::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin 0.7s linear infinite;
}

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

/* — Divider — */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--auth-text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-glass-border);
}

/* — Social / Alt login — */
.auth-social-row {
    display: flex;
    gap: 12px;
}

.auth-social-btn {
    flex: 1;
    padding: 12px;
    background: var(--auth-glass);
    border: 1px solid var(--auth-glass-border);
    border-radius: var(--auth-radius-sm);
    color: var(--auth-text);
    cursor: pointer;
    transition: var(--auth-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 500;
}

.auth-social-btn:hover {
    background: var(--auth-glass-hover);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* — Password Strength Meter — */
.auth-pw-strength {
    margin-top: -12px;
    margin-bottom: 18px;
}

.auth-pw-meter {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.auth-pw-meter-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.4s ease, background 0.4s ease;
}

.auth-pw-meter-fill.weak   { width: 33%; background: var(--auth-danger); }
.auth-pw-meter-fill.medium { width: 66%; background: var(--auth-warning); }
.auth-pw-meter-fill.strong { width: 100%; background: var(--auth-success); }

.auth-pw-label {
    font-size: 0.78rem;
    color: var(--auth-text-muted);
    transition: color 0.3s;
}

.auth-pw-label.weak   { color: var(--auth-danger); }
.auth-pw-label.medium { color: var(--auth-warning); }
.auth-pw-label.strong { color: var(--auth-success); }

/* — Password Requirements — */
.auth-pw-reqs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
    margin-bottom: 20px;
}

.auth-pw-req {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--auth-text-muted);
    transition: color 0.3s;
}

.auth-pw-req-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    transition: all 0.3s;
}

.auth-pw-req.valid { color: var(--auth-success); }
.auth-pw-req.valid .auth-pw-req-dot {
    background: var(--auth-success);
    border-color: var(--auth-success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.auth-pw-req.invalid { color: var(--auth-danger); }
.auth-pw-req.invalid .auth-pw-req-dot {
    border-color: var(--auth-danger);
}

/* — Terms checkbox — */
.auth-terms {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 24px;
    cursor: pointer;
}

.auth-terms input {
    display: none;
}

.auth-terms-box {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--auth-transition);
    margin-top: 1px;
}

.auth-terms-box i {
    font-size: 0.7rem;
    color: #fff;
    opacity: 0;
    transform: scale(0);
    transition: var(--auth-transition);
}

.auth-terms input:checked + .auth-terms-box {
    background: var(--auth-primary);
    border-color: var(--auth-primary);
}

.auth-terms input:checked + .auth-terms-box i {
    opacity: 1;
    transform: scale(1);
}

.auth-terms-text {
    color: var(--auth-text-muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.auth-terms-text a {
    color: var(--auth-primary-light);
    text-decoration: none;
}

.auth-terms-text a:hover {
    text-decoration: underline;
}

/* — Footer link — */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--auth-glass-border);
    color: var(--auth-text-muted);
    font-size: 0.88rem;
}

.auth-footer a {
    color: var(--auth-primary-light);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--auth-transition);
}

.auth-footer a:hover {
    color: var(--auth-accent-light);
}

/* — Flash Messages — */
.auth-flash {
    padding: 12px 16px;
    border-radius: var(--auth-radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    animation: authFadeSlideIn 0.3s ease;
}

.auth-flash-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.auth-flash-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.auth-flash-info {
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--auth-accent-light);
}

.auth-flash-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

/* — Post Register / Profile Completion — */
.auth-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 28px;
}

.auth-step {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transition: var(--auth-transition);
}

.auth-step.active {
    background: var(--auth-primary);
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.5);
    width: 32px;
    border-radius: 5px;
}

.auth-step.done {
    background: var(--auth-success);
}

.auth-two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.auth-gender-row {
    display: flex;
    gap: 12px;
    margin-bottom: 22px;
}

.auth-gender-opt {
    flex: 1;
    position: relative;
}

.auth-gender-opt input {
    display: none;
}

.auth-gender-opt label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--auth-glass);
    border: 1.5px solid var(--auth-glass-border);
    border-radius: var(--auth-radius-sm);
    color: var(--auth-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--auth-transition);
    text-transform: none;
    letter-spacing: 0;
    margin: 0;
    padding-left: 12px;
}

.auth-gender-opt input:checked + label {
    border-color: var(--auth-primary-light);
    background: rgba(124, 58, 237, 0.15);
    color: var(--auth-text);
}

/* — Select styling — */
.auth-select {
    width: 100%;
    padding: 14px 16px 14px 46px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--auth-radius-sm);
    color: var(--auth-text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--auth-transition);
    outline: none;
    appearance: none;
    cursor: pointer;
}

.auth-select option {
    background: #1e1b4b;
    color: #fff;
}

.auth-select:focus {
    border-color: var(--auth-primary-light);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

/* — Textarea — */
.auth-textarea {
    width: 100%;
    padding: 14px 16px;
    min-height: 80px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--auth-radius-sm);
    color: var(--auth-text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--auth-transition);
    outline: none;
    resize: vertical;
}

.auth-textarea:focus {
    border-color: var(--auth-primary-light);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

/* — Success animation — */
.auth-success-view {
    text-align: center;
    padding: 30px 0;
}

.auth-success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid var(--auth-success);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: var(--auth-success);
    animation: authSuccessPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes authSuccessPop {
    0%   { transform: scale(0); }
    80%  { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.auth-success-view h3 {
    color: var(--auth-text);
    font-size: 1.3rem;
    margin: 0 0 10px;
}

.auth-success-view p {
    color: var(--auth-text-muted);
    font-size: 0.9rem;
}

/* — Back link — */
.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--auth-text-muted);
    font-size: 0.88rem;
    text-decoration: none;
    transition: color var(--auth-transition);
    margin-top: 20px;
}

.auth-back:hover {
    color: var(--auth-text);
}

/* — Single-panel pages (forgot / reset) — */
.auth-single {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

.auth-single .auth-card {
    max-width: 440px;
}

.auth-single-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-single-header .auth-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(124, 58, 237, 0.15);
    border: 2px solid var(--auth-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    font-size: 1.6rem;
    color: var(--auth-primary-light);
}

/* — Responsive — */
@media (max-width: 1024px) {
    .auth-brand {
        flex: 0 0 38%;
        padding: 40px 32px;
    }
    .auth-brand h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .auth-wrapper {
        flex-direction: column;
    }
    .auth-brand {
        flex: none;
        padding: 40px 24px 24px;
    }
    .auth-features {
        display: none;
    }
    .auth-form-side {
        padding: 24px 20px 40px;
    }
    .auth-card {
        padding: 28px 24px;
    }
    .auth-pw-reqs {
        grid-template-columns: 1fr;
    }
    .auth-two-cols {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .auth-brand {
        padding: 28px 20px 16px;
    }
    .auth-brand h1 {
        font-size: 1.5rem;
    }
    .auth-brand p {
        font-size: 0.9rem;
        margin-bottom: 16px;
    }
    .auth-card {
        padding: 24px 18px;
    }
    .auth-tab {
        padding: 10px 12px;
        font-size: 0.82rem;
    }
}
