/* ============================================================
   AboPilot – Passwort-Reset-Seite
   Vanilla CSS, kein Framework, kein Build-Prozess
   Hell- und Dunkelmodus via prefers-color-scheme
   ============================================================ */

/* ── Design Tokens ── */
:root {
  --brand-primary: #6C63FF;
  --brand-dark:    #4F46E5;
  --brand-light:   #EEF2FF;

  --bg:            #F4F6FB;
  --surface:       #FFFFFF;
  --border:        #E2E8F0;
  --shadow:        0 4px 24px rgba(108, 99, 255, 0.10), 0 1px 4px rgba(0,0,0,0.06);
  --shadow-sm:     0 1px 4px rgba(0,0,0,0.08);

  --text-primary:  #1A202C;
  --text-secondary:#64748B;
  --text-muted:    #94A3B8;

  --error-bg:      #FFF1F2;
  --error-color:   #E11D48;
  --error-border:  #FECDD3;

  --success-bg:    #F0FDF4;
  --success-color: #16A34A;
  --success-border:#BBF7D0;

  --icon-error:    #E11D48;
  --icon-success:  #16A34A;
  --icon-lock:     #6C63FF;

  --input-bg:      #FFFFFF;
  --input-border:  #CBD5E1;
  --input-focus:   #6C63FF;
  --placeholder:   #94A3B8;

  --radius-card:   20px;
  --radius-input:  10px;
  --radius-btn:    12px;

  --font: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --transition: 0.2s ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:            #0F1117;
    --surface:       #1C1E2E;
    --border:        #2D3148;
    --shadow:        0 4px 32px rgba(0,0,0,0.5), 0 1px 8px rgba(0,0,0,0.4);
    --shadow-sm:     0 1px 4px rgba(0,0,0,0.3);

    --text-primary:  #F1F5F9;
    --text-secondary:#94A3B8;
    --text-muted:    #64748B;

    --error-bg:      #2D0A14;
    --error-color:   #FB7185;
    --error-border:  #4C0519;

    --success-bg:    #052E16;
    --success-color: #4ADE80;
    --success-border:#14532D;

    --input-bg:      #161827;
    --input-border:  #2D3148;
    --input-focus:   #818CF8;
    --placeholder:   #4B5563;

    --brand-light:   #1E1B4B;
    --icon-error:    #FB7185;
    --icon-success:  #4ADE80;
    --icon-lock:     #818CF8;
  }
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100dvh;
  display: flex;
  align-items: stretch;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  width: 100%;
  align-items: center;
}

.header {
  width: 100%;
  padding: 20px 24px;
  display: flex;
  justify-content: center;
}

.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 16px 40px;
  width: 100%;
}

.footer {
  width: 100%;
  text-align: center;
  padding: 16px 24px 24px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer-link {
  color: var(--brand-primary);
  text-decoration: none;
}
.footer-link:hover { text-decoration: underline; }

/* ── Logo ── */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
}

.logo-text {
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

/* ── Card ── */
.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  min-height: 200px;
  display: flex;
  align-items: stretch;
  transition: box-shadow var(--transition);
}

@media (max-width: 480px) {
  .card { padding: 32px 24px; border-radius: 16px; }
}

/* ── Views ── */
.view {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}

.hidden { display: none !important; }

/* ── Icons ── */
.icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.icon-wrap svg {
  width: 28px;
  height: 28px;
}

.icon-error  { background: var(--error-bg);   color: var(--icon-error); }
.icon-success{ background: var(--success-bg); color: var(--icon-success); }
.icon-lock   { background: var(--brand-light); color: var(--icon-lock); }

/* ── Typography ── */
.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.card-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 28px;
}

/* ── Form ── */
form {
  width: 100%;
  text-align: left;
}

.field-group {
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.input-wrap {
  position: relative;
}

.input {
  width: 100%;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-input);
  padding: 12px 44px 12px 14px;
  font-size: 1rem;
  font-family: var(--font);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input::placeholder { color: var(--placeholder); }

.input:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.input.has-error {
  border-color: var(--error-color);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12);
}

.toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}

.toggle-pw:hover { color: var(--brand-primary); }
.eye-icon { width: 18px; height: 18px; }

.field-error {
  display: block;
  color: var(--error-color);
  font-size: 0.8rem;
  margin-top: 5px;
  font-weight: 500;
}

.field-error-global {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-color);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.875rem;
  margin-bottom: 16px;
  text-align: left;
  line-height: 1.5;
}

/* ── Button ── */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  margin-top: 8px;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 14px rgba(108, 99, 255, 0.35);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.92;
  box-shadow: 0 6px 20px rgba(108, 99, 255, 0.45);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(108, 99, 255, 0.3);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ── Button spinner ── */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ── Card loading spinner ── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Success extras ── */
#open-app-btn { margin-top: 4px; }

.hint-text {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.6;
  margin-top: 16px;
  text-align: center;
}
