@import url('tokens.css');
@import url('components.css');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --brand: #c0392b;
  --brand-hover: #a93226;
  --text-main: #1a1a1a;
  --text-muted: #6b7280;
  --line: #d1d5db;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --danger: #dc2626;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;

  --fs-body: 13px;
  --fs-body-sm: 12px;
  --fs-caption: 11px;
  --fs-overline: 10px;
  --fs-heading-lg: 22px;
  --fs-heading-md: 22px;
  --fs-heading-sm: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.45;
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  background-image: url('/media/eb-town-hall.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  z-index: 0;
}

.auth-shell {
  width: 100%;
  min-height: 100dvh;
  padding: var(--space-2) var(--space-2) var(--space-4);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
}

.card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border-radius: 14px;
  padding: var(--space-3);
  width: 100%;
  max-width: 430px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  text-align: center;
}

.logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-2);
}

.logo-wrap img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e5e5e5;
}

h1 {
  font-size: var(--fs-heading-md);
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: var(--space-1);
}

.subtitle {
  font-size: var(--fs-body-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.form-group {
  text-align: left;
  margin-bottom: var(--space-2);
}

label {
  display: block;
  font-size: var(--fs-body-sm);
  font-weight: 500;
  color: #374151;
  margin-bottom: var(--space-1);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  color: #9ca3af;
  display: flex;
  align-items: center;
}

.input-icon svg {
  width: 17px;
  height: 17px;
}

input[type='email'],
input[type='password'],
input[type='text'] {
  width: 100%;
  padding: 10px 38px 10px 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: var(--fs-body-sm);
  color: #111827;
  background: var(--surface-soft);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
  background: #fff;
}

input.error-input {
  border-color: #ef4444;
  background: #fef2f2;
}

input::placeholder {
  color: #9ca3af;
}

.error-text {
  display: block;
  font-size: var(--fs-caption);
  color: var(--danger);
  margin-top: 4px;
  text-align: left;
}

.alert {
  padding: var(--space-2);
  border-radius: 8px;
  margin-bottom: var(--space-2);
  font-size: var(--fs-body-sm);
  line-height: 1.5;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.footer-text {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: calc(100% - 20px);
  z-index: 1;
  font-size: var(--fs-caption);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

@media (max-height: 760px) {
  .card {
    padding: 22px 18px 18px;
    max-width: 390px;
  }

  .logo-wrap img {
    width: 52px;
    height: 52px;
  }

  h1 {
    font-size: 21px;
  }

  .subtitle {
    margin-bottom: 14px;
  }

  .footer-text {
    bottom: 8px;
  }
}
