/* ═══════════════════════════════════════════
   Goldmann Brandschutz GmbH – Design System
   ═══════════════════════════════════════════ */

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

:root {
  /* Brand Colors */
  --clr-primary: #9A001A;
  --clr-primary-h: #B80020;
  --clr-secondary: #54595F;
  --clr-text: #7A7A7A;
  --clr-accent: #61CE70;
  --clr-danger: #EF0029;

  /* Surfaces */
  --clr-bg: #0f1117;
  --clr-surface: #1a1d27;
  --clr-card: rgba(26, 29, 39, .72);
  --clr-border: rgba(255, 255, 255, .08);
  --clr-text-light: #e4e6ed;

  /* Typography */
  --font-primary: 'Roboto', system-ui, sans-serif;
  --font-secondary: 'Roboto Slab', serif;
  --fw-primary: 600;
  --fw-secondary: 400;
  --fw-text: 400;
  --fw-accent: 500;

  /* Misc */
  --radius: 14px;
  --shadow: 0 8px 32px rgba(0, 0, 0, .45);
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font-primary);
  font-weight: var(--fw-text);
  background: var(--clr-bg);
  color: var(--clr-text-light);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* ─── Animated Background ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(154, 0, 26, .14), transparent),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(239, 0, 41, .08), transparent);
  z-index: 0;
  pointer-events: none;
  animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0% {
    opacity: .6;
  }

  100% {
    opacity: 1;
  }
}

/* ─── Floating Particles ─── */
.particle {
  position: fixed;
  border-radius: 50%;
  background: var(--clr-primary);
  opacity: .06;
  pointer-events: none;
  z-index: 0;
}

.particle:nth-child(1) {
  width: 320px;
  height: 320px;
  top: -80px;
  left: -60px;
  animation: float 14s ease-in-out infinite;
}

.particle:nth-child(2) {
  width: 200px;
  height: 200px;
  bottom: -40px;
  right: -30px;
  animation: float 11s ease-in-out infinite reverse;
}

.particle:nth-child(3) {
  width: 140px;
  height: 140px;
  top: 40%;
  left: 70%;
  animation: float 16s ease-in-out infinite 2s;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -20px) scale(1.05);
  }

  66% {
    transform: translate(-20px, 15px) scale(.95);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

/* ─── Card ─── */
.card {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 1rem;
  padding: 2.5rem 2rem 2rem;
  background: var(--clr-card);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: cardIn .6s cubic-bezier(.22, 1, .36, 1) both;
}

.card--login {
  max-width: 420px;
}

.card--register {
  max-width: 520px;
}

/* ─── Brand ─── */
.brand {
  text-align: center;
  margin-bottom: 2rem;
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-h));
  margin-bottom: 1rem;
  box-shadow: 0 4px 20px rgba(154, 0, 26, .35);
}

.brand-icon svg {
  width: 34px;
  height: 34px;
  fill: #fff;
}

/* Brand Logo Images */
.brand-logo {
  max-width: 280px;
  height: auto;
  margin-bottom: .8rem;
}

.brand-logo-sm {
  width: 60px;
  height: auto;
  margin-bottom: .8rem;
}

.brand h1 {
  font-family: var(--font-secondary);
  font-size: 1.35rem;
  font-weight: var(--fw-secondary);
  letter-spacing: -.02em;
  color: #fff;
  line-height: 1.3;
}

.brand p {
  font-size: .82rem;
  color: var(--clr-text);
  margin-top: .35rem;
  font-weight: 400;
}

.brand--sm .brand-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.brand--sm .brand-icon svg {
  width: 30px;
  height: 30px;
}

.brand--sm h1 {
  font-size: 1.25rem;
}

.brand--sm p {
  font-size: .8rem;
}

.brand--sm {
  margin-bottom: 1.8rem;
}

/* ─── Section Headers ─── */
.section-title {
  font-size: .72rem;
  font-weight: var(--fw-primary);
  color: var(--clr-primary);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 1.6rem 0 .8rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--clr-border);
}

.section-title:first-of-type {
  margin-top: .4rem;
}

/* ─── Form ─── */
.form-row {
  display: flex;
  gap: .75rem;
}

.form-group {
  margin-bottom: 1.15rem;
  flex: 1;
}

.form-group label {
  display: block;
  font-size: .78rem;
  font-weight: var(--fw-accent);
  color: var(--clr-text);
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.input-wrapper {
  position: relative;
}

.input-wrapper svg.ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  fill: var(--clr-text);
  transition: fill .25s;
  pointer-events: none;
}

.input-wrapper input,
.input-wrapper select {
  width: 100%;
  padding: .8rem .9rem .8rem 2.8rem;
  font-size: .92rem;
  font-family: inherit;
  color: var(--clr-text-light);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--clr-border);
  border-radius: 10px;
  outline: none;
  transition: border-color .25s, box-shadow .25s, background .25s;
  appearance: none;
  -webkit-appearance: none;
}

.input-wrapper select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%237A7A7A'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 2.2rem;
}

.input-wrapper select option {
  background: var(--clr-surface);
  color: var(--clr-text-light);
}

.input-wrapper input::placeholder {
  color: rgba(122, 122, 122, .55);
}

.input-wrapper input:focus,
.input-wrapper select:focus {
  border-color: var(--clr-primary);
  background: rgba(255, 255, 255, .07);
  box-shadow: 0 0 0 3px rgba(154, 0, 26, .18);
}

.input-wrapper input:focus~svg.ico,
.input-wrapper select:focus~svg.ico {
  fill: var(--clr-primary);
}

/* No-icon inputs */
.input-wrapper.no-icon input,
.input-wrapper.no-icon select {
  padding-left: .85rem;
}

/* ─── Password Toggle ─── */
.toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-pw svg {
  position: static;
  transform: none;
  width: 18px;
  height: 18px;
  fill: var(--clr-text);
  transition: fill .2s;
}

.toggle-pw:hover svg {
  fill: var(--clr-text-light);
}

/* ─── Password Strength ─── */
.pw-strength {
  margin-top: .5rem;
}

.pw-strength-bar {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
  margin-bottom: .3rem;
}

.pw-strength-fill {
  height: 100%;
  border-radius: 3px;
  width: 0%;
  transition: width .35s ease, background .35s ease;
}

.pw-strength-text {
  font-size: .72rem;
  font-weight: 500;
  color: var(--clr-text);
  transition: color .3s;
}

.pw-strength-reqs {
  margin-top: .45rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .2rem .6rem;
}

.pw-req {
  font-size: .7rem;
  color: var(--clr-text);
  display: flex;
  align-items: center;
  gap: .3rem;
  transition: color .25s;
}

.pw-req .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  flex-shrink: 0;
  transition: background .25s;
}

.pw-req.met {
  color: var(--clr-accent);
}

.pw-req.met .dot {
  background: var(--clr-accent);
}

/* ─── Password Match ─── */
.pw-match-msg {
  font-size: .72rem;
  font-weight: 500;
  margin-top: .35rem;
  min-height: 1rem;
  transition: color .25s;
}

.pw-match-msg.ok {
  color: var(--clr-accent);
}

.pw-match-msg.error {
  color: var(--clr-danger);
}

/* ─── Copy Button ─── */
.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .35rem .65rem;
  font-size: .7rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--clr-primary);
  background: rgba(154, 0, 26, .1);
  border: 1px solid rgba(154, 0, 26, .25);
  border-radius: 7px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  margin-top: .35rem;
}

.btn-copy:hover {
  background: rgba(154, 0, 26, .18);
  border-color: rgba(154, 0, 26, .4);
}

.btn-copy svg {
  width: 13px;
  height: 13px;
  fill: var(--clr-primary);
}

/* ─── Alert Messages ─── */
.alert {
  display: none;
  align-items: center;
  gap: .45rem;
  padding: .65rem .85rem;
  margin-bottom: 1rem;
  font-size: .82rem;
  border-radius: 10px;
}

.alert.visible {
  display: flex;
}

.alert svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.alert-error {
  color: var(--clr-danger);
  background: rgba(239, 0, 41, .08);
  border: 1px solid rgba(239, 0, 41, .18);
}

.alert-error svg {
  fill: var(--clr-danger);
}

.alert-success {
  color: var(--clr-accent);
  background: rgba(97, 206, 112, .08);
  border: 1px solid rgba(97, 206, 112, .18);
}

.alert-success svg {
  fill: var(--clr-accent);
}

/* ─── Buttons ─── */
.btn-primary {
  width: 100%;
  padding: .85rem;
  font-size: .95rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-h));
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .15s, box-shadow .25s, opacity .2s;
  box-shadow: 0 4px 16px rgba(154, 0, 26, .3);
  position: relative;
  overflow: hidden;
  margin-top: .3rem;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(154, 0, 26, .45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: .65;
  cursor: not-allowed;
  transform: none;
}

.btn-primary .spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin: 0 auto;
}

.btn-primary.loading .btn-text {
  display: none;
}

.btn-primary.loading .spinner {
  display: block;
}

/* ─── Links ─── */
.link-secondary {
  display: block;
  text-align: center;
  margin-top: 1.1rem;
  font-size: .82rem;
  color: var(--clr-text);
  text-decoration: none;
  transition: color .2s;
}

.link-secondary:hover {
  color: var(--clr-primary);
}

/* ─── Footer ─── */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  text-align: center;
  padding: .8rem 1rem;
  font-size: .7rem;
  color: var(--clr-secondary);
  letter-spacing: .03em;
  opacity: .55;
  background: linear-gradient(to top, var(--clr-bg), transparent);
}

footer span {
  margin: 0 .35rem;
}

/* ─── Responsive ─── */
@media (max-width: 540px) {
  .card {
    padding: 2rem 1.4rem 1.6rem;
    border-radius: 12px;
  }

  .brand h1 {
    font-size: 1.15rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .pw-strength-reqs {
    grid-template-columns: 1fr;
  }
}