/* Builder CRM — Premium Auth Styles */
:root {
    --navy: #142B4A; --navy-dark: #0E1E36;
    --blue: #2563EB; --blue-dark: #1D4ED8;
    --teal: #14B8A6; --bg: #F5F7FB;
    --card: #FFFFFF; --text: #1E293B; --muted: #64748B;
    --border: #E2E8F0; --success: #16A34A; --danger: #DC2626;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    height: 100%; font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg); color: var(--text);
    -webkit-font-smoothing: antialiased;
}
.auth-wrapper {
    display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh;
}
.auth-brand {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 50%, #0A1628 100%);
    color: white; padding: 60px 80px;
    display: flex; flex-direction: column; justify-content: space-between;
    position: relative; overflow: hidden;
}
.brand-content { position: relative; z-index: 2; }
.brand-logo { margin-bottom: 32px; animation: floatIn 0.8s ease-out; }
.brand-title {
    font-size: 40px; font-weight: 800; letter-spacing: -1px;
    line-height: 1.15; margin-bottom: 16px;
    animation: floatIn 0.8s ease-out 0.1s both;
}
.brand-tagline {
    font-size: 15px; line-height: 1.65; color: rgba(255,255,255,0.7);
    margin-bottom: 48px; animation: floatIn 0.8s ease-out 0.2s both;
}
.brand-tagline span { color: var(--teal); font-weight: 600; }
.brand-features { display: flex; flex-direction: column; gap: 24px; }
.feature-item {
    display: flex; gap: 16px; align-items: flex-start;
    animation: floatIn 0.8s ease-out both;
}
.feature-item:nth-child(1) { animation-delay: 0.3s; }
.feature-item:nth-child(2) { animation-delay: 0.4s; }
.feature-item:nth-child(3) { animation-delay: 0.5s; }
.feature-icon {
    width: 44px; height: 44px;
    background: rgba(20, 184, 166, 0.15);
    border: 1px solid rgba(20, 184, 166, 0.3);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: var(--teal); font-size: 18px; flex-shrink: 0;
}
.feature-item strong { display: block; font-size: 15px; margin-bottom: 4px; }
.feature-item span { font-size: 13px; color: rgba(255,255,255,0.6); }
.brand-footer {
    font-size: 13px; color: rgba(255,255,255,0.4);
    position: relative; z-index: 2;
}
.blob {
    position: absolute; border-radius: 50%;
    filter: blur(80px); opacity: 0.4; pointer-events: none;
}
.blob-1 { width: 400px; height: 400px; background: var(--teal); top: -150px; right: -100px; animation: floatBlob 15s ease-in-out infinite; }
.blob-2 { width: 300px; height: 300px; background: var(--blue); bottom: -100px; left: -80px; animation: floatBlob 18s ease-in-out infinite reverse; }
.blob-3 { width: 200px; height: 200px; background: var(--teal); top: 50%; right: 10%; opacity: 0.2; animation: floatBlob 20s ease-in-out infinite; }

.auth-form-side {
    display: flex; align-items: center; justify-content: center;
    padding: 40px; background: var(--bg);
}
.form-container {
    width: 100%; max-width: 420px; background: var(--card);
    padding: 48px 44px; border-radius: 24px;
    box-shadow: 0 4px 6px -1px rgba(20,43,74,0.04),
                0 20px 50px -10px rgba(20,43,74,0.12);
    animation: slideUp 0.5s ease-out;
}
.form-header { margin-bottom: 32px; text-align: center; }
.form-header h2 {
    font-size: 26px; font-weight: 800; color: var(--navy);
    letter-spacing: -0.5px; margin-bottom: 8px;
}
.form-header p { font-size: 14px; color: var(--muted); }
.form-group { margin-bottom: 20px; }
.form-label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--text); margin-bottom: 8px;
}
.input-wrap { position: relative; display: flex; align-items: center; }
.input-icon {
    position: absolute; left: 16px; color: var(--muted);
    font-size: 14px; pointer-events: none;
}
.form-input {
    width: 100%; padding: 14px 16px 14px 46px;
    border: 1.5px solid var(--border); border-radius: 12px;
    font-family: inherit; font-size: 14px; color: var(--text);
    background: #FBFCFE; transition: all 0.25s ease; outline: none;
}
.form-input::placeholder { color: #94A3B8; }
.form-input:hover { border-color: #CBD5E1; }
.form-input:focus {
    border-color: var(--blue); background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}
.form-input:focus + .input-icon,
.input-wrap:focus-within .input-icon { color: var(--blue); }
.form-input.is-invalid { border-color: var(--danger); background: #FEF2F2; }
#password { padding-right: 46px; }
.toggle-password {
    position: absolute; right: 12px; background: transparent;
    border: none; color: var(--muted); cursor: pointer;
    padding: 6px; font-size: 14px; border-radius: 6px;
}
.toggle-password:hover { color: var(--navy); background: #F1F5F9; }
.field-error {
    display: block; font-size: 12px; color: var(--danger);
    margin-top: 6px; min-height: 14px;
}
.form-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
}
.checkbox-wrap {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; user-select: none; font-size: 13px; color: var(--text);
}
.checkbox-wrap input[type="checkbox"] { display: none; }
.checkmark {
    width: 18px; height: 18px; border: 1.5px solid var(--border);
    border-radius: 5px; background: #fff; position: relative;
    transition: all 0.2s; flex-shrink: 0;
}
.checkbox-wrap input:checked ~ .checkmark {
    background: var(--blue); border-color: var(--blue);
}
.checkbox-wrap input:checked ~ .checkmark::after {
    content: ''; position: absolute; top: 1px; left: 5px;
    width: 4px; height: 9px; border: solid white;
    border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.forgot-link {
    font-size: 13px; color: var(--blue); text-decoration: none; font-weight: 600;
}
.forgot-link:hover { text-decoration: underline; }
.btn-login {
    width: 100%; padding: 15px 24px;
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
    color: white; border: none; border-radius: 12px;
    font-family: inherit; font-size: 15px; font-weight: 700;
    letter-spacing: 0.3px; cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}
.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.35);
}
.btn-login:disabled { opacity: 0.75; cursor: not-allowed; }
.btn-spinner { display: inline-block; margin-left: 8px; }
.login-alert {
    padding: 12px 16px; border-radius: 10px; font-size: 13px;
    margin-bottom: 20px; line-height: 1.5;
    animation: shakeIn 0.4s ease-out;
}
.login-alert.error {
    background: #FEF2F2; color: #991B1B; border-left: 3px solid var(--danger);
}
.login-alert.success {
    background: #F0FDF4; color: #166534; border-left: 3px solid var(--success);
}
.login-alert i { margin-right: 6px; }
.demo-creds {
    margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border);
}
.demo-toggle {
    width: 100%; background: #F8FAFC; border: 1px solid var(--border);
    padding: 12px 16px; border-radius: 10px;
    font-family: inherit; font-size: 13px; font-weight: 600;
    color: var(--muted); cursor: pointer;
    display: flex; align-items: center; justify-content: space-between;
}
.demo-toggle:hover { background: #F1F5F9; color: var(--navy); }
.demo-toggle i:first-child { margin-right: 8px; color: var(--teal); }
.demo-chevron { transition: transform 0.3s; }
.demo-toggle.open .demo-chevron { transform: rotate(180deg); }
.demo-list {
    margin-top: 12px; background: #F8FAFC;
    border-radius: 10px; padding: 8px; border: 1px solid var(--border);
}
.demo-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px;
    cursor: pointer; font-size: 12px;
}
.demo-item:hover { background: white; box-shadow: 0 2px 8px rgba(20,43,74,0.06); }
.demo-role {
    padding: 3px 8px; border-radius: 6px; font-size: 10px;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.demo-role.owner { background: #FEF3C7; color: #92400E; }
.demo-role.admin { background: #DBEAFE; color: #1E40AF; }
.demo-role.sales { background: #D1FAE5; color: #065F46; }
.demo-role.accounts { background: #EDE9FE; color: #5B21B6; }
.demo-email {
    color: var(--muted); font-family: monospace; font-size: 11px;
}
.demo-pass {
    margin-top: 10px; padding: 10px 12px; background: #ECFDF5;
    border-radius: 6px; font-size: 12px; color: #065F46; text-align: center;
}
.demo-pass code {
    background: white; padding: 2px 8px; border-radius: 4px;
    font-family: monospace; color: var(--navy); font-weight: 600;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes floatIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes floatBlob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(30px, -40px) scale(1.05); }
    66%      { transform: translate(-20px, 30px) scale(0.95); }
}
@keyframes shakeIn {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-8px); }
    75%      { transform: translateX(8px); }
}
@media (max-width: 1024px) {
    .auth-wrapper { grid-template-columns: 1fr; }
    .auth-brand { padding: 40px 32px; min-height: auto; }
    .brand-title { font-size: 28px; }
    .brand-features { display: none; }
    .brand-footer { display: none; }
    .form-container { padding: 32px 24px; }
}
@media (max-width: 480px) {
    .form-container { padding: 28px 20px; }
    .form-header h2 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}