/* ============================================
   SAI IRC Panel - Auth CSS
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-glow: rgba(99,102,241,0.3);
    --bg: #0a0a0f;
    --bg2: #111118;
    --bg3: #1a1a2e;
    --card: #13131f;
    --border: rgba(255,255,255,0.08);
    --text: #e2e8f0;
    --text-muted: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 12px;
}

body.auth-body {
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text);
    overflow: hidden;
    position: relative;
}

/* Animated background */
body.auth-body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 20%, rgba(139,92,246,0.06) 0%, transparent 40%),
                radial-gradient(ellipse at 60% 80%, rgba(16,185,129,0.04) 0%, transparent 40%);
    animation: bgFloat 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0,0) rotate(0deg); }
    33% { transform: translate(-2%, 2%) rotate(0.5deg); }
    66% { transform: translate(2%, -1%) rotate(-0.3deg); }
}

.auth-bg-text {
    position: fixed;
    bottom: -60px;
    right: -30px;
    font-size: 200px;
    font-weight: 900;
    color: rgba(99,102,241,0.04);
    line-height: 1;
    pointer-events: none;
    user-select: none;
    letter-spacing: -10px;
}

.auth-wrapper {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03), inset 0 1px 0 rgba(255,255,255,0.06);
    animation: slideUp 0.4s ease;
}

.auth-card-wide { max-width: 560px; }
.auth-wrapper:has(.auth-card-wide) { max-width: 560px; }

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

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; color: #fff;
    margin: 0 auto 16px;
    box-shadow: 0 8px 30px var(--primary-glow);
}

.logo-icon.logo-success { background: linear-gradient(135deg, var(--success), #059669); box-shadow: 0 8px 30px rgba(16,185,129,0.3); }
.logo-icon.logo-error { background: linear-gradient(135deg, var(--danger), #dc2626); box-shadow: 0 8px 30px rgba(239,68,68,0.3); }

.auth-logo h1 { font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.auth-logo p { font-size: 14px; color: var(--text-muted); }

/* Alerts */
.alert {
    padding: 12px 16px; border-radius: 10px;
    font-size: 14px; margin-bottom: 20px;
    display: flex; align-items: center; gap: 8px;
}
.alert-danger { background: rgba(239,68,68,0.12); color: #fca5a5; border: 1px solid rgba(239,68,68,0.2); }
.alert-success { background: rgba(16,185,129,0.12); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.2); }

/* Form */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 13px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.input-icon { position: relative; }
.input-icon > i {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 14px; z-index: 1;
}
.input-icon input {
    width: 100%; padding: 12px 14px 12px 40px;
    background: rgba(255,255,255,0.05); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text);
    font-size: 15px; transition: all 0.2s;
    outline: none;
}
.input-icon input:focus {
    border-color: var(--primary);
    background: rgba(99,102,241,0.08);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.input-icon input::placeholder { color: var(--text-muted); }
.toggle-pw {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 4px; transition: color 0.2s;
}
.toggle-pw:hover { color: var(--text); }

.forgot-link { font-size: 12px; color: var(--primary); text-decoration: none; font-weight: 400; text-transform: none; letter-spacing: 0; }
.forgot-link:hover { text-decoration: underline; }

.form-check-row { display: flex; align-items: center; margin-bottom: 20px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Password strength */
.password-strength {
    height: 4px; background: rgba(255,255,255,0.08);
    border-radius: 2px; margin: -12px 0 8px; overflow: hidden;
}
.strength-fill { height: 100%; width: 0; border-radius: 2px; transition: all 0.3s; }
.strength-label { font-size: 12px; text-align: right; margin-bottom: 16px; height: 16px; }

/* Plan preview */
.plan-preview {
    background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2);
    border-radius: 10px; padding: 12px 16px;
    font-size: 13px; color: #6ee7b7;
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 20px;
}

/* Auth Button */
.btn-auth {
    width: 100%; padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none; border-radius: var(--radius);
    color: #fff; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 4px 20px var(--primary-glow);
    text-decoration: none; margin-bottom: 16px;
}
.btn-auth:hover { transform: translateY(-1px); box-shadow: 0 6px 25px var(--primary-glow); }
.btn-auth:active { transform: translateY(0); }

.terms-text { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 8px; }
.terms-text a { color: var(--primary); text-decoration: none; }

.auth-footer {
    text-align: center; font-size: 14px;
    color: var(--text-muted); margin-top: 20px;
    padding-top: 20px; border-top: 1px solid var(--border);
}
.auth-footer a { color: var(--primary); text-decoration: none; font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

/* Mobile */
@media (max-width: 560px) {
    .auth-card { padding: 28px 24px; border-radius: 16px; }
    .form-row-2 { grid-template-columns: 1fr; }
    .auth-bg-text { font-size: 130px; }
}

/* IRC Section */
.irc-section {
    margin-top: 20px;
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 10px;
    padding: 18px;
    background: rgba(99,102,241,0.04);
}
.irc-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(99,102,241,0.15);
}

/* OS Warning */
.os-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.25);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    color: #f59e0b;
    margin-top: 12px;
    line-height: 1.5;
}
.os-warning svg { flex-shrink: 0; margin-top: 2px; }
.os-warning code {
    background: rgba(245,158,11,0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #fbbf24;
}
.os-warning strong { color: #fbbf24; }

/* Confirm Box */
.confirm-box {
    margin-top: 16px;
    background: rgba(16,185,129,0.06);
    border: 1px solid rgba(16,185,129,0.25);
    border-radius: 8px;
    padding: 14px 16px;
}
.confirm-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-muted);
}
.confirm-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: #10b981;
    cursor: pointer;
}
.confirm-label strong { color: #10b981; }

/* Plan Preview */
.plan-preview {
    background: rgba(99,102,241,0.08);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}
.plan-preview i { color: var(--primary); }
.plan-preview strong { color: var(--text); }

/* Password strength */
.password-strength {
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}
.strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
}
.strength-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    min-height: 16px;
}

/* Checkbox label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
}
.checkbox-label input { accent-color: var(--primary); }

/* Form check row */
.form-check-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.forgot-link {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    float: right;
}
.forgot-link:hover { text-decoration: underline; }

/* Alert */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-danger {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: #fca5a5;
}
.alert-success {
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.3);
    color: #6ee7b7;
}

/* Auth footer */
.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}
.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.auth-footer a:hover { text-decoration: underline; }

/* Logo */
.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}
.auth-logo h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin: 10px 0 4px;
}
.auth-logo p {
    font-size: 14px;
    color: var(--text-muted);
}
.logo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin-bottom: 4px;
}
.logo-icon.logo-error { background: linear-gradient(135deg, #ef4444, #dc2626); }
.logo-icon.logo-success { background: linear-gradient(135deg, #10b981, #059669); }

/* Auth BG text */
.auth-bg-text {
    position: fixed;
    bottom: -20px;
    right: -20px;
    font-size: 200px;
    font-weight: 900;
    color: rgba(255,255,255,0.02);
    pointer-events: none;
    user-select: none;
    line-height: 1;
}

/* Toggle password button */
.toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
}
.toggle-pw:hover { color: var(--text); }
