/* XZILY AI Studio — Auth Pages (Login & Register) */

/* ── Page background ── */
.aqs-auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Card ── */
.aqs-auth-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    padding: 40px 36px 36px;
    width: 100%;
    max-width: 440px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}
@media (max-width: 480px) {
    .aqs-auth-card { padding: 28px 20px 24px; border-radius: 18px; }
}

/* ── Brand ── */
.aqs-auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 28px;
}
.aqs-auth-logo-icon {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
    box-shadow: 0 8px 24px rgba(99,102,241,0.45);
}
.aqs-auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 6px;
    text-align: center;
    line-height: 1.2;
}
.aqs-auth-subtitle {
    font-size: 0.875rem;
    color: #94a3b8;
    text-align: center;
    margin: 0;
    line-height: 1.5;
}

/* ── Alert / Message ── */
.aqs-auth-alert {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 16px;
    display: none;
    animation: aqsAlertIn 0.2s ease;
}
@keyframes aqsAlertIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }
.aqs-auth-alert.error   { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.aqs-auth-alert.success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }
.aqs-auth-alert.show    { display: block; }

/* ── Social buttons ── */
.aqs-social-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}
.aqs-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}
.aqs-social-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.25);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.aqs-social-btn:active { transform: translateY(0); }
.aqs-social-btn svg { flex-shrink: 0; }

/* Provider colours on hover */
.aqs-social-btn.google:hover   { background: rgba(66,133,244,0.2);  border-color: rgba(66,133,244,0.45); }
.aqs-social-btn.github:hover   { background: rgba(255,255,255,0.14);border-color: rgba(255,255,255,0.3); }
.aqs-social-btn.microsoft:hover{ background: rgba(0,120,212,0.2);   border-color: rgba(0,120,212,0.45); }
.aqs-social-btn.yahoo:hover    { background: rgba(126,0,210,0.2);   border-color: rgba(126,0,210,0.45); }

/* ── Divider ── */
.aqs-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 20px;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 500;
}
.aqs-auth-divider::before,
.aqs-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.1);
}

/* ── Fields ── */
.aqs-auth-field {
    margin-bottom: 14px;
}
.aqs-auth-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}
.aqs-auth-field input,
.aqs-auth-field select {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    color: #f1f5f9;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.18s, background 0.18s;
    box-sizing: border-box;
}
.aqs-auth-field input::placeholder { color: #475569; }
.aqs-auth-field input:focus {
    border-color: rgba(99,102,241,0.7);
    background: rgba(99,102,241,0.08);
}
.aqs-auth-field input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #1e1b4b inset !important;
    -webkit-text-fill-color: #f1f5f9 !important;
}

/* Password field with toggle */
.aqs-pw-wrap {
    position: relative;
}
.aqs-pw-wrap input { padding-right: 42px; }
.aqs-pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}
.aqs-pw-toggle:hover { color: #a5b4fc; }

/* Two-column row for name+username etc */
.aqs-auth-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 520px) {
    .aqs-auth-row-2 { grid-template-columns: 1fr; }
    .aqs-auth-card { padding: 24px 16px 20px; border-radius: 16px; max-width: 100%; }
    .aqs-auth-page { padding: 16px 10px; align-items: flex-start; padding-top: 20px; }
    .aqs-auth-title { font-size: 1.25rem; }
    .aqs-role-chips { gap: 6px; }
    .aqs-role-chip { font-size: 0.75rem; padding: 5px 11px; }
    .aqs-social-btn { font-size: 0.85rem; padding: 10px 14px; }
    .aqs-auth-field input { font-size: 1rem; }
}

/* ── Role selector ── */
.aqs-role-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}
.aqs-role-chip {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.aqs-role-chip:hover { border-color: rgba(99,102,241,0.5); color: #c7d2fe; }
.aqs-role-chip.selected {
    background: rgba(99,102,241,0.25);
    border-color: rgba(99,102,241,0.7);
    color: #a5b4fc;
}

/* ── Submit button ── */
.aqs-auth-submit {
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    margin-top: 6px;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
    font-family: inherit;
    box-shadow: 0 4px 16px rgba(99,102,241,0.4);
}
.aqs-auth-submit:hover { opacity: 0.92; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(99,102,241,0.45); }
.aqs-auth-submit:active { transform: translateY(0); }
.aqs-auth-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ── Switch link ── */
.aqs-auth-switch {
    text-align: center;
    font-size: 0.82rem;
    color: #64748b;
    margin: 16px 0 0;
}
.aqs-auth-switch a {
    color: #818cf8;
    text-decoration: none;
    font-weight: 600;
}
.aqs-auth-switch a:hover { color: #a5b4fc; text-decoration: underline; }

/* ── Spinner inside button ── */
.aqs-auth-spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: aqsSpin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes aqsSpin { to { transform: rotate(360deg); } }

/* ── Password strength bar ── */
.aqs-pw-strength {
    height: 3px;
    border-radius: 2px;
    margin-top: 6px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}
.aqs-pw-strength-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
    width: 0%;
}
.aqs-pw-strength-bar.weak   { background: #ef4444; width: 33%; }
.aqs-pw-strength-bar.medium { background: #f59e0b; width: 66%; }
.aqs-pw-strength-bar.strong { background: #10b981; width: 100%; }

/* ── Checkbox ── */
.aqs-auth-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 8px;
    cursor: pointer;
}
.aqs-auth-check input { margin: 0; flex-shrink: 0; cursor: pointer; }
.aqs-auth-check a { color: #818cf8; text-decoration: none; }
.aqs-auth-check a:hover { text-decoration: underline; }

/* OAuth error notice (shown when ?aqs_oauth_error=1) */
.aqs-oauth-notice {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.83rem;
    color: #fca5a5;
    margin-bottom: 18px;
    text-align: center;
}
.aqs-oauth-success {
    background: rgba(16,185,129,0.12);
    border: 1px solid rgba(16,185,129,0.3);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.83rem;
    color: #6ee7b7;
    margin-bottom: 18px;
    text-align: center;
}

/* ── Social Login Buttons ── */
.aqs-social-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}
.aqs-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    letter-spacing: 0.01em;
}
.aqs-social-btn:hover {
    background: rgba(255,255,255,0.11);
    border-color: rgba(255,255,255,0.22);
    transform: translateY(-1px);
}
.aqs-social-btn:active { transform: translateY(0); }
.aqs-social-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.aqs-social-google svg { flex-shrink: 0; }

/* ── Divider ── */
.aqs-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: #475569;
    font-size: 0.78rem;
}
.aqs-auth-divider::before,
.aqs-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.08);
}

/* ── Mobile Auth Improvements ── */
@media (max-width: 480px) {
    .aqs-auth-wrap { padding: 16px; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
    .aqs-auth-card { width: 100%; margin: 0; padding: 28px 20px; border-radius: 16px; }
    .aqs-auth-logo { font-size: 2.5rem; margin-bottom: 16px; }
    .aqs-role-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .aqs-role-btn { padding: 12px 8px; font-size: 0.8rem; }
    .aqs-btn { min-height: 48px; font-size: 1rem; }
    .aqs-field label { font-size: 0.85rem; }
    .aqs-field input { font-size: 1rem; padding: 12px 14px; }
}
