/* ═══════════════════════════════════
   ARVIS — login (apex)
   Mirroir de la LoginPage React
═══════════════════════════════════ */

:root {
  color-scheme: light;
  --orange: #B24E24;
  --orange-light: #C4552A;
  --orange-dark: #953F18;
  --orange-ghost: #F8EDE5;

  --red: #C13A2B;
  --success: #3A8B5C;
  --error: #C13A2B;

  --bg: #F6F4F1;
  --bg-2: #FDFCFA;
  --bg-3: #F0EDE7;
  --text: #1A1815;
  --text-2: #55514B;
  --text-3: #8A8680;
  --border: #E5E2DA;

  --shadow: 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; background: var(--bg-2); }
body {
  min-height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-weight: 400;
  background: var(--bg-2);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--orange); }
button { font-family: inherit; }

/* ═══════════════════════════════════
   LAYOUT
═══════════════════════════════════ */
#loginPage {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}
.login-brand-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-decoration: none;
  margin-bottom: 32px;
  align-self: center;
}

.login-left {
  background: linear-gradient(145deg, #1a0a05, #2d1008, #B24E24);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 64px;
  position: relative;
  overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(217,75,10,0.4), transparent 70%);
  border-radius: 50%;
}
.login-left::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,100,30,0.2), transparent 70%);
  border-radius: 50%;
}

.login-brand {
  position: relative;
  z-index: 1;
  margin-bottom: 64px;
  text-align: left;
}
.login-tagline {
  font-size: 15px;
  color: rgba(255,255,255,0.6);
  font-weight: 400;
}

.login-headline {
  position: relative;
  z-index: 1;
}
.login-headline h2 {
  font-family: 'Inter', sans-serif;
  font-size: 32px;
  font-weight: 600;
  color: white;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
.login-headline p {
  font-size: 15px;
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
  font-weight: 400;
  max-width: 380px;
}

.login-features {
  position: relative;
  z-index: 1;
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.login-feature:last-child { border-bottom: none; }
.login-feature-icon {
  width: 18px; height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: rgba(255,255,255,0.6);
}
.login-feature span {
  font-size: 14.5px;
  color: rgba(255,255,255,0.85);
  font-weight: 400;
}

/* Right panel */
.login-right {
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 64px;
  position: relative;
  overflow-y: auto;
}
.login-form-container {
  width: 100%;
  max-width: 360px;
  margin: auto;
  display: flex;
  flex-direction: column;
}

/* Tabs */
.login-tabs {
  display: flex;
  gap: 0;
  background: var(--bg);
  border-radius: 5px;
  padding: 3px;
  border: 1px solid var(--border);
  margin-bottom: 28px;
}
.login-tab {
  flex: 1;
  padding: 8px;
  border-radius: 4px;
  border: none;
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
}
.login-tab.active {
  background: var(--bg-2);
  color: var(--text);
  box-shadow: var(--shadow);
}

/* Forms */
.form-title {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.form-sub {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 24px;
  font-weight: 400;
}

.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.form-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 22px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(178,78,36,0.12);
}
.form-input::placeholder { color: var(--text-3); }

.form-input-group { position: relative; }
.form-input-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.form-input-icon:hover { color: var(--text-2); }

.form-forgot {
  text-align: right;
  margin-top: 6px;
}
.form-forgot a {
  font-size: 13px;
  color: var(--orange);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}
.form-forgot a:hover { text-decoration: underline; }

.btn-submit {
  width: 100%;
  padding: 11px 16px;
  border-radius: 6px;
  border: 1px solid var(--orange);
  background: var(--orange);
  color: white;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-submit:hover:not(:disabled) {
  background: var(--orange-dark);
  border-color: var(--orange-dark);
}
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.form-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
}
.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.form-divider span {
  font-size: 13px;
  color: var(--text-3);
  white-space: nowrap;
}

.btn-google {
  width: 100%;
  padding: 11px 16px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-google:hover { background: var(--bg-3); border-color: var(--text-3); }

.form-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-3);
}
.form-footer a {
  color: var(--orange);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}
.form-footer a:hover { text-decoration: underline; }

.dsgvo-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  margin-top: 20px;
}
.dsgvo-note span {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.5;
}
.dsgvo-note a { color: var(--orange); }

/* Banners (error / info) — hidden by default; JS toggles via style.display */
.msg {
  display: none;
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  line-height: 1.45;
}
.msg-error {
  background: var(--orange-ghost);
  color: var(--orange);
}
.msg-info {
  background: rgba(58,139,92,0.07);
  color: var(--success);
}

/* Legal footer */
.login-legal {
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
  margin-top: 24px;
}
.login-legal a {
  color: var(--text-3);
  text-decoration: none;
  margin: 0 8px;
}
.login-legal a:hover { color: var(--text-2); }

/* ═══════════════════════════════════
   CALLBACK / CONFIRM PAGES
═══════════════════════════════════ */
.auth-callback {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: linear-gradient(145deg, #1a0a05, #2d1008, #B24E24);
}
.auth-callback-card {
  background: var(--bg-2);
  border-radius: 12px;
  padding: 40px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.auth-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--orange);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: arvis-spin 0.7s linear infinite;
}
@keyframes arvis-spin {
  to { transform: rotate(360deg); }
}
.auth-callback-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.auth-callback-sub {
  font-size: 14px;
  color: var(--text-3);
}
.auth-callback-error {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--orange-ghost);
  color: var(--orange);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}
.auth-callback-back {
  display: inline-block;
  margin-top: 18px;
  padding: 10px 18px;
  border-radius: 6px;
  background: var(--orange);
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--orange);
}
.auth-callback-back:hover {
  background: var(--orange-dark);
  border-color: var(--orange-dark);
}

/* ═══════════════════════════════════
   RESPONSIVE
═══════════════════════════════════ */
@media (max-width: 900px) {
  #loginPage { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .login-right { padding: 32px 24px; min-height: 100vh; }
}

@media (max-width: 480px) {
  .login-right { padding: 24px 16px; }
  .login-headline h2 { font-size: 26px; }
  .login-form-container { max-width: 100%; }
  .form-title { font-size: 18px; }
}
