/*
 * HomeHub AI — Login / Register Page
 * Premium split-screen design
 */

:root {
  --purple:       #7c3aed;
  --purple-light: #8b5cf6;
  --purple-bg:    rgba(124,58,237,.08);
  --indigo:       #4f46e5;
  --dark:         #0f172a;
  --text:         #1e293b;
  --muted:        #64748b;
  --border:       #e2e8f0;
  --white:        #ffffff;
  --green:        #10b981;
  --danger:       #ef4444;
  --grad:         linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  --grad-dark:    linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
  --sh-pur:       0 8px 28px rgba(124,58,237,.30);
  --r:            12px;
  --r-lg:         18px;
  --r-xl:         24px;
  --r-full:       9999px;
  --t:            all .22s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

body {
  min-height: 100vh; height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  background: var(--grad-dark);
  overflow-x: hidden;
}

/* ── Layout ─────────────────────────────────────────── */
.auth-layout {
  display: flex;
  width: 100%; min-height: 100vh;
}

/* ── Left Brand Panel ───────────────────────────────── */
.auth-brand {
  display: none;
  flex: 0 0 45%;
  background: var(--grad-dark);
  position: relative; overflow: hidden;
  padding: 56px 52px;
  flex-direction: column; justify-content: space-between;
}

/* Decorative orbs */
.auth-brand::before {
  content: ''; position: absolute;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,.22) 0%, transparent 70%);
  top: -100px; right: -120px; pointer-events: none;
}
.auth-brand::after {
  content: ''; position: absolute;
  width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(79,70,229,.15) 0%, transparent 70%);
  bottom: -80px; left: -60px; pointer-events: none;
}

.brand-top { position: relative; z-index: 1; }
.brand-logo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 56px; }
.brand-logo-box {
  width: 40px; height: 40px; background: var(--grad);
  border-radius: 11px; display: flex; align-items: center;
  justify-content: center; font-size: 20px; flex-shrink: 0;
}
.brand-logo-text { font-size: 20px; font-weight: 800; color: #fff; }

.brand-headline {
  font-size: clamp(2rem, 3.5vw, 2.8rem); font-weight: 900;
  color: #fff; line-height: 1.1; letter-spacing: -.025em; margin-bottom: 20px;
}
.brand-headline .hl {
  background: linear-gradient(135deg, #a78bfa, #c084fc);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-sub {
  font-size: 15px; color: rgba(255,255,255,.65);
  line-height: 1.7; max-width: 340px; margin-bottom: 44px;
}

/* Feature list */
.brand-features { display: flex; flex-direction: column; gap: 18px; }
.brand-feature {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 18px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r); transition: var(--t);
}
.brand-feature:hover { background: rgba(255,255,255,.1); }
.brand-feat-icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: rgba(139,92,246,.25); color: #c4b5fd;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0; margin-top: 1px;
}
.brand-feat-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 3px; }
.brand-feat-desc  { font-size: 12px; color: rgba(255,255,255,.55); line-height: 1.5; }

/* Testimonial */
.brand-bottom { position: relative; z-index: 1; }
.brand-quote {
  padding: 20px; background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r-lg);
}
.brand-quote-text {
  font-size: 14px; color: rgba(255,255,255,.8);
  line-height: 1.65; font-style: italic; margin-bottom: 14px;
}
.brand-quote-author { display: flex; align-items: center; gap: 10px; }
.brand-quote-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--grad); display: flex; align-items: center;
  justify-content: center; font-size: 14px; font-weight: 700;
  color: #fff; flex-shrink: 0;
}
.brand-quote-name { font-size: 13px; font-weight: 700; color: #fff; }
.brand-quote-role { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 2px; }
.brand-quote-stars { display: flex; gap: 2px; margin-left: auto; }
.brand-quote-stars i { color: #f59e0b; font-size: 12px; }

/* ── Right Form Panel ───────────────────────────────── */
.auth-form-panel {
  flex: 1;
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 28px;
  position: relative;
  border-radius: 0;
}

/* Background decoration for mobile */
.auth-form-panel::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 6px;
  background: var(--grad);
}

.login-page {
  width: 100%; max-width: 440px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

/* Header */
.login-header { text-align: center; margin-bottom: 32px; }
.logo-container { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 6px; }
.logo-image {
  height: 52px; width: auto; max-width: 180px;
  object-fit: contain;
}
.logo-text { font-size: 1.6rem; font-weight: 800; color: var(--purple); }
.platform-title { font-size: 14px; color: var(--muted); font-weight: 400; margin-top: 4px; margin-bottom: 20px; }

/* Role selection */
.role-selection { display: flex; gap: 12px; margin-bottom: 24px; }
.role-card {
  flex: 1; display: flex; align-items: center; gap: 12px;
  padding: 16px 14px; background: var(--purple-bg);
  border: 2px solid transparent; border-radius: var(--r-lg);
  cursor: pointer; transition: var(--t); color: var(--text);
}
.role-card:hover {
  border-color: rgba(124,58,237,.3);
  background: rgba(124,58,237,.1);
  transform: translateY(-2px); box-shadow: 0 4px 14px rgba(124,58,237,.18);
}
.role-card.active {
  background: var(--grad) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: var(--sh-pur);
  transform: translateY(-2px);
}
.role-card.active .role-content h3,
.role-card.active .role-content p { color: #fff !important; }
.role-emoji { font-size: 1.8rem; flex-shrink: 0; }
.role-content h3 { font-size: 14px; font-weight: 700; margin-bottom: 2px; color: var(--text); }
.role-content p  { font-size: 12px; color: var(--muted); opacity: .85; }

/* Instruction text */
.signin-message { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 20px; }

/* Form */
.login-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: .2px; }

.form-group input,
.password-input-wrapper input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  font-size: 14px; font-family: inherit;
  color: var(--text); background: #fff;
  transition: var(--t); outline: none;
}
.form-group input:focus,
.password-input-wrapper input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124,58,237,.12);
}
.form-group input::placeholder { color: #cbd5e1; }

/* Password wrapper */
.password-input-wrapper {
  position: relative; display: flex; align-items: center;
}
.password-input-wrapper input { padding-right: 46px; }
.password-toggle {
  position: absolute; right: 12px; background: none; border: none;
  cursor: pointer; padding: 6px; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: color .2s; z-index: 2;
}
.password-toggle:hover { color: var(--text); }
.password-toggle .eye-icon { width: 18px; height: 18px; stroke: currentColor; }

/* Form options row */
.form-options {
  display: flex; justify-content: space-between; align-items: center;
}
.remember-checkbox {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text); cursor: pointer; user-select: none;
}
.remember-checkbox input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: var(--purple); cursor: pointer;
}
.forgot-link { font-size: 13px; color: var(--purple); font-weight: 600; text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }

/* Submit button */
.signin-btn {
  width: 100%; padding: 14px;
  background: var(--grad); color: #fff;
  border: none; border-radius: var(--r-lg);
  font-size: 15px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: var(--t);
  box-shadow: var(--sh-pur); letter-spacing: .2px;
}
.signin-btn:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 12px 32px rgba(124,58,237,.4); }
.signin-btn:active { transform: translateY(0); }
.signin-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* Divider */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--muted); margin: 4px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Social buttons */
.social-buttons { display: flex; flex-direction: column; gap: 10px; }
.social-btn {
  width: 100%; padding: 12px;
  background: #fff; color: var(--text);
  border: 1.5px solid var(--border); border-radius: var(--r);
  font-size: 14px; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: var(--t);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.social-btn:hover { border-color: rgba(124,58,237,.35); background: var(--purple-bg); color: var(--purple); }

/* Error message */
.error-message {
  font-size: 13px; text-align: center; min-height: 0;
  padding: 0; display: none; border-radius: var(--r);
}
.error-message.showing, .error-message.locked-error {
  display: block; color: #dc2626;
  padding: 10px 14px; background: #fef2f2;
  border-radius: var(--r); border-left: 3px solid #dc2626;
}
.error-message.locked-error { border-left-color: #991b1b; color: #991b1b; font-weight: 500; }
.attempts-warning { font-size: 11px; margin-top: 4px; opacity: .8; }

/* Register link */
.register-link { text-align: center; font-size: 13px; color: var(--muted); margin-top: 8px; }
.register-link a { color: var(--purple); font-weight: 600; }
.register-link a:hover { text-decoration: underline; }

/* ── Responsive ─────────────────────────────────────── */

/* Tablet: 768px+ — show brand panel */
@media (min-width: 768px) {
  .auth-brand { display: flex; }
  .auth-form-panel { padding: 60px 72px; border-radius: 0; }
  .auth-form-panel::before { display: none; }
}

/* Large desktop: wider brand panel */
@media (min-width: 1200px) {
  .auth-brand { flex: 0 0 42%; padding: 64px 64px; }
}

/* Mobile: single column */
@media (max-width: 767px) {
  body { background: #fff; }
  .auth-layout { background: var(--white); }
  .auth-form-panel { padding: 32px 20px 48px; align-items: flex-start; }
  .login-page { max-width: 100%; }
  .role-selection { flex-direction: column; }
  .role-card { flex-direction: row; }
}

@media (max-width: 400px) {
  .auth-form-panel { padding: 24px 16px 40px; }
}
