/*------------------------------------------------------------------------------
  Desc: Styles fuer Authentifizierung
--------------------------------------------------------------------------------
  File: public/css/auth.css
--------------------------------------------------------------------------------
  Author: Marcus A. Inzinger
--------------------------------------------------------------------------------
  Date/ Changes: erstellt am 2026-04-15 / aktualisiert am 2026-04-15
------------------------------------------------------------------------------*/

/* auth.css – Bogenjäger/Wald-Thema für ArcApes Authentifizierung */

/* ============================================================ Custom Properties */
:root {
  --clr-forest-dark:   #80131b;
  --clr-forest:        #9ea48c;
  --clr-forest-mid:    #b7bca6;
  --clr-forest-light:  #daddcd;
  --clr-forest-pale:   #f6f6f2;
  --clr-bark:          #80131b;
  --clr-bark-light:    #c99090;
  --clr-gold:          #80131b;
  --clr-gold-light:    #80131b;
  --clr-text:          #221718;
  --clr-text-muted:    #675759;
  --clr-danger:        #80131b;
  --clr-success:       #56604b;
  --clr-card-bg:       rgba(246, 246, 242, 0.96);
  --clr-input-bg:      rgba(255, 255, 255, 0.92);
  --clr-border:        rgba(128, 19, 27, 0.18);
  --radius:            24px;
  --shadow:            0 18px 40px rgba(62, 24, 28, 0.18);
  --transition:        0.2s ease;
  --font-body:         'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display:      'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive;
}

.full-viewport-height {
  height: 100vh;
}

@supports (height: 100dvh) {
  .full-viewport-height {
    height: 100dvh;
  }
}

/* ============================================================ Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  min-height: 100%;
  min-height: -webkit-fill-available;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  background-color: var(--clr-forest-dark);
  background-image:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(218, 221, 205, 0.18), transparent 36%),
    linear-gradient(180deg, #8b1d27 0%, #6d1017 100%);
  font-family: var(--font-body);
  color: var(--clr-text);
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 0;
}

/* ============================================================ Hintergrund */
.bg-overlay {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='84' height='84' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 42h60M42 12v60M18 18l48 48M66 18L18 66' stroke='%23ffffff' stroke-width='0.6' opacity='0.09' fill='none'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ============================================================ Container */
.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: transparent;
  backdrop-filter: blur(6px);
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ============================================================ Branding */
.brand {
  position: relative;
  text-align: center;
  padding: 1.5rem 1rem 1rem;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.12), transparent 32%),
    linear-gradient(180deg, rgba(139,29,39,0.96) 0%, rgba(128,19,27,0.98) 100%);
  border-bottom: 1px solid rgba(255,255,255,0.18);
  color: #fff;
}

.brand::before,
.brand::after {
  content: '';
  position: absolute;
  bottom: 1rem;
  width: 28px;
  height: 56px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.9;
}

.brand::before {
  left: 0.9rem;
  background-image: url('../images/o_left.png');
}

.brand::after {
  right: 0.9rem;
  background-image: url('../images/o_right.png');
}

.brand-stage {
  width: 100%;
  max-width: 25rem;
  margin: 0 auto;
}

.brand-hero {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 10rem;
  margin-bottom: 0.55rem;
}

.brand-hero-image {
  width: min(100%, 15rem);
  height: auto;
  display: block;
  filter: drop-shadow(0 14px 26px rgba(69, 8, 13, 0.28));
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: center;
}

.brand-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.82);
}

.brand-kicker::before,
.brand-kicker::after {
  content: '';
  width: 1.7rem;
  height: 1px;
  background: rgba(255,255,255,0.4);
}

.brand-title {
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  font-family: var(--font-display);
  text-shadow: none;
  margin: 0.25rem 0 0.1rem;
}

.brand-subtitle {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.9);
  letter-spacing: 0.05em;
}

.brand-description {
  max-width: 24rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: rgba(255,255,255,0.78);
}

/* ============================================================ Tabs */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--clr-border);
  width: calc(100% - 2rem);
  max-width: 28rem;
  margin: 1rem auto 0;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(128,19,27,0.14);
  border-radius: 18px 18px 0 0;
  overflow: hidden;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 0.9rem;
  color: var(--clr-text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border-bottom: 2px solid transparent;
}

.tab-btn:hover { background: rgba(74,140,66,0.1); color: var(--clr-text); }
.tab-btn:hover { background: rgba(128,19,27,0.05); color: var(--clr-text); }

.tab-btn.active {
  color: var(--clr-gold-light);
  border-bottom-color: var(--clr-bark);
  background: rgba(128,19,27,0.06);
}

/* ============================================================ Panels */
.auth-panel {
  padding: 1.2rem 1rem 1.4rem;
  width: calc(100% - 2rem);
  max-width: 28rem;
  margin: 0 auto;
  background: var(--clr-card-bg);
  border: 1px solid var(--clr-border);
  border-top: none;
  box-shadow: var(--shadow);
}

#panel-login,
#panel-register,
#panel-forgot {
  border-radius: 0 0 22px 22px;
}

.auth-panel.active { display: block; }
.auth-panel[hidden] { display: none; }

/* ============================================================ Formularfelder */
.auth-form { display: flex; flex-direction: column; gap: 1rem; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-group label {
  font-size: 0.85rem;
  color: var(--clr-text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--clr-input-bg);
  border: 1px solid var(--clr-border);
  border-width: 0 0 1px;
  border-radius: 0;
  color: var(--clr-text);
  font-size: 0.95rem;
  padding: 0.85rem 0.1rem 0.65rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
  font-family: var(--font-body);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--clr-bark);
  box-shadow: 0 0 0 3px rgba(128,19,27,0.1);
}

.form-group input::placeholder { color: rgba(103,87,89,0.55); }

.input-group {
  display: flex;
  gap: 0;
}

.input-group input {
  border-radius: 0;
  flex: 1;
}

.toggle-pw {
  background: var(--clr-input-bg);
  border: 1px solid var(--clr-border);
  border-left: none;
  border-radius: 0;
  color: var(--clr-text-muted);
  cursor: pointer;
  padding: 0 0.8rem;
  font-size: 1rem;
  transition: background var(--transition);
}

.toggle-pw:hover { background: rgba(74,140,66,0.2); }

/* Passwort-Stärke */
.pw-strength {
  margin-top: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pw-bar {
  height: 4px;
  border-radius: 2px;
  flex: 1;
  background: rgba(255,255,255,0.1);
  transition: width var(--transition), background-color var(--transition);
}

#pw-label { font-size: 0.75rem; color: var(--clr-text-muted); min-width: 60px; }

/* CAPTCHA */
.captcha-group { }

.captcha-display {
  background: #fff;
  border: 1px solid var(--clr-border);
  border-radius: 14px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.captcha-row {
  display: flex;
  gap: 0.5rem;
}

.captcha-row input { flex: 1; }

.btn-icon {
  background: var(--clr-input-bg);
  border: 1px solid var(--clr-border);
  border-radius: 14px;
  color: var(--clr-text-muted);
  cursor: pointer;
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  transition: background var(--transition);
}

.btn-icon:hover { background: rgba(74,140,66,0.2); color: var(--clr-text); }

/* Checkbox */
.checkbox-group { flex-direction: row; align-items: flex-start; }
.checkbox-label {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.85rem;
  color: var(--clr-text-muted);
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; margin-top: 2px; }
.checkbox-label input[type="checkbox"] { accent-color: var(--clr-bark); }

/* ============================================================ Fehler */
.field-error {
  font-size: 0.78rem;
  color: var(--clr-danger);
  min-height: 1em;
  display: block;
}

/* ============================================================ Buttons */
.form-actions { margin-top: 0.5rem; }

.btn-primary {
  width: 100%;
  background: var(--clr-bark);
  border: 1px solid rgba(128,19,27,0.18);
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.9rem 1.5rem;
  transition: filter var(--transition), transform var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 10px 22px rgba(128,19,27,0.18);
}

.btn-primary:hover:not(:disabled) { filter: brightness(1.15); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-loader { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================ Footer / Links */
.form-footer {
  text-align: center;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.link { color: var(--clr-bark); text-decoration: none; }
.link:hover { color: var(--clr-gold-light); text-decoration: underline; }

/* Panel-Header (Passwort vergessen) */
.panel-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.panel-header h2 { font-size: 1.1rem; }
.back-btn {
  background: none;
  border: none;
  color: var(--clr-text-muted);
  cursor: pointer;
  font-size: 0.9rem;
}
.back-btn:hover { color: var(--clr-text); }

.form-hint { font-size: 0.85rem; color: var(--clr-text-muted); margin-bottom: 0.5rem; }

/* ============================================================ Alerts */
.alert {
  border-radius: 14px;
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  text-align: center;
}
.alert.success { background: rgba(158,164,140,0.2); color: #3f4938; border: 1px solid rgba(158,164,140,0.35); }
.alert.error   { background: rgba(128,19,27,0.08); color: #80131b; border: 1px solid rgba(128,19,27,0.2); }

/* ============================================================ Utilitites */
.hidden { display: none !important; }

/* ============================================================ Responsiv */
@media (min-width: 640px) {
  body {
    align-items: flex-start;
    padding: 2rem 1rem;
  }

  .auth-container {
    min-height: calc(100vh - 4rem);
    min-height: calc(100dvh - 4rem);
    max-width: 1050px;
    border-radius: 32px;
  }

  .brand {
    padding: 2rem 2rem 1.4rem;
    border-radius: 32px 32px 0 0;
  }

  .auth-tabs,
  .auth-panel {
    max-width: 32rem;
  }

  .auth-panel { padding: 1.5rem 2rem 2rem; }
}

@media (min-width: 980px) {
  .auth-container {
    display: grid;
    grid-template-columns: minmax(320px, 0.95fr) minmax(420px, 0.85fr);
    align-items: stretch;
  }

  .brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 2.25rem;
    border-radius: 32px 0 0 32px;
    border-bottom: none;
    min-height: calc(100vh - 4rem);
    min-height: calc(100dvh - 4rem);
  }

  .brand::before,
  .brand::after {
    bottom: 2rem;
  }

  .brand-stage {
    max-width: 22rem;
  }

  .brand-hero {
    min-height: 16rem;
    margin-bottom: 0.75rem;
  }

  .brand-hero-image {
    width: min(100%, 19rem);
  }

  .auth-tabs {
    align-self: end;
    width: calc(100% - 3rem);
    margin-top: 2.25rem;
  }

  .auth-panel {
    width: calc(100% - 3rem);
  }

  #panel-login,
  #panel-register,
  #panel-forgot {
    min-height: 33rem;
  }
}

/* EoF
------------------------------------------------------------------------------*/