:root {
  color-scheme: dark;
  --auth-background: #080a0e;
  --auth-panel: #11141a;
  --auth-input: #1d2431;
  --auth-border: #343b49;
  --auth-primary: #ffb32c;
  --auth-primary-hover: #ffc04d;
  --auth-text: #ffffff;
  --auth-muted: #a7acb7;
  --auth-error: #ff8a7a;
  --auth-success: #9ae6b4;
  --auth-success-bg: rgba(72, 187, 120, 0.12);
  --auth-success-border: rgba(72, 187, 120, 0.32);
  --auth-link-hover: #ffd789;
  --auth-form-shadow: none;
  --auth-logo-bg: transparent;
  --auth-logo-border: transparent;
  --auth-media-heading: #ffffff;
  --auth-media-text: rgba(255, 255, 255, 0.88);
  --auth-media-muted: rgba(255, 255, 255, 0.74);
  --auth-media-badge-bg: rgba(8, 10, 14, 0.46);
  --auth-media-badge-border: rgba(255, 179, 44, 0.34);
  --auth-media-badge-text: #ffc04d;
  --auth-line: rgba(255, 255, 255, 0.1);
  --auth-line-amber: rgba(245, 166, 35, 0.3);
  --auth-input-focus: #232b3a;
  --auth-input-hover-border: #4a5568;
  --auth-placeholder: #8b93a2;
  --auth-secondary-hover: rgba(255, 255, 255, 0.05);
  --auth-google-bg: rgba(255, 255, 255, 0.05);
  --auth-google-hover: rgba(255, 255, 255, 0.08);
  --auth-danger-bg: rgba(255, 91, 73, 0.1);
  --auth-danger-border: rgba(255, 138, 122, 0.36);
  --auth-visual-overlay: linear-gradient(to bottom, rgba(8, 10, 14, 0.05), rgba(8, 10, 14, 0.35) 55%, rgba(8, 10, 14, 0.92));
  --theme-toggle-bg: rgba(8, 10, 14, 0.62);
  --theme-toggle-bg-hover: rgba(8, 10, 14, 0.78);
  --theme-toggle-border: rgba(255, 255, 255, 0.22);
  --theme-toggle-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}


:root[data-theme="light"] {
  color-scheme: light;
  --auth-background: #f6f3ee;
  --auth-panel: #fbfaf8;
  --auth-input: #ffffff;
  --auth-border: #d9d4ca;
  --auth-primary: #e5a11f;
  --auth-primary-hover: #c98606;
  --auth-text: #181714;
  --auth-muted: #5f625f;
  --auth-error: #b42318;
  --auth-success: #166534;
  --auth-success-bg: rgba(22, 101, 52, 0.08);
  --auth-success-border: rgba(22, 101, 52, 0.24);
  --auth-link-hover: #8a5a00;
  --auth-form-shadow: inset -1px 0 0 rgba(24, 23, 20, 0.03);
  --auth-logo-bg: #ffffff;
  --auth-logo-border: rgba(24, 23, 20, 0.08);
  --auth-media-heading: #ffffff;
  --auth-media-text: rgba(255, 255, 255, 0.9);
  --auth-media-muted: rgba(255, 255, 255, 0.76);
  --auth-media-badge-bg: rgba(8, 10, 14, 0.54);
  --auth-media-badge-border: rgba(255, 179, 44, 0.4);
  --auth-media-badge-text: #ffd27a;
  --auth-line: rgba(24, 23, 20, 0.1);
  --auth-line-amber: rgba(197, 132, 14, 0.34);
  --auth-input-focus: #ffffff;
  --auth-input-hover-border: #bdb6aa;
  --auth-placeholder: #6f716f;
  --auth-secondary-hover: rgba(24, 23, 20, 0.04);
  --auth-google-bg: #ffffff;
  --auth-google-hover: #f7f4ef;
  --auth-danger-bg: rgba(180, 35, 24, 0.08);
  --auth-danger-border: rgba(180, 35, 24, 0.24);
  --auth-visual-overlay: linear-gradient(to bottom, rgba(8, 10, 14, 0.06) 0%, rgba(8, 10, 14, 0.24) 42%, rgba(8, 10, 14, 0.74) 100%), radial-gradient(circle at 52% 16%, rgba(255, 179, 44, 0.1), transparent 34rem);
  --theme-toggle-bg: rgba(255, 255, 255, 0.86);
  --theme-toggle-bg-hover: #ffffff;
  --theme-toggle-border: rgba(24, 23, 20, 0.12);
  --theme-toggle-shadow: 0 12px 28px rgba(41, 35, 25, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--auth-background);
  color: var(--auth-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 44%) minmax(0, 56%);
}

.auth-form-section {
  background: var(--auth-panel);
  border-right: 1px solid var(--auth-line);
  box-shadow: var(--auth-form-shadow);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
}

.auth-form-wrapper {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.auth-brand {
  margin-bottom: 32px;
}

.auth-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: var(--auth-logo-bg);
  border: 1px solid var(--auth-logo-border);
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(24, 23, 20, 0.08);
}

.auth-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-content h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--auth-text);
  line-height: 1.2;
}

.auth-supporting {
  color: var(--auth-muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 28px;
}

.auth-form {
  margin-bottom: 24px;
}

.field {
  margin: 18px 0;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--auth-text);
}

.field input {
  width: 100%;
  border: 1px solid var(--auth-border);
  border-radius: 10px;
  padding: 0 16px;
  height: 48px;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  background: var(--auth-input);
  color: var(--auth-text);
}

.field input:focus {
  outline: none;
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(255, 179, 44, 0.12);
  background: var(--auth-input-focus);
}

.field input::placeholder {
  color: var(--auth-placeholder);
}

.field input:hover {
  border-color: var(--auth-input-hover-border);
}

.field input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.field-validation-error {
  color: var(--auth-error);
  font-size: 13px;
  margin-top: 4px;
  display: block;
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 24px;
}

.check {
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
}

.check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--auth-primary);
  cursor: pointer;
}

.check label {
  font-size: 14px;
  color: var(--auth-muted);
  cursor: pointer;
  line-height: 1.4;
}

.auth-link {
  color: var(--auth-primary-hover);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s ease;
}

.auth-link:hover {
  color: var(--auth-link-hover);
  text-decoration: underline;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0 24px;
  height: 48px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  width: 100%;
}

.btn-primary {
  background: var(--auth-primary);
  color: #181006;
  box-shadow: 0 2px 8px rgba(255, 179, 44, 0.2);
}

.btn-primary:hover {
  background: var(--auth-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(255, 179, 44, 0.28);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--auth-primary);
  outline-offset: 2px;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary-outline {
  background: transparent;
  border: 1px solid var(--auth-border);
  color: var(--auth-text);
  width: auto;
}

.btn-secondary-outline:hover {
  background: var(--auth-secondary-hover);
  border-color: var(--auth-line-amber);
}

.btn-secondary-outline:focus-visible {
  outline: 2px solid var(--auth-primary);
  outline-offset: 2px;
}

.btn-google {
  background: var(--auth-google-bg);
  color: var(--auth-text);
  border: 1px solid var(--auth-border);
  position: relative;
}

.btn-google:hover {
  background: var(--auth-google-hover);
  border-color: var(--auth-line-amber);
}

.btn-google:focus-visible {
  outline: 2px solid var(--auth-primary);
  outline-offset: 2px;
}

.btn-google::before {
  content: '';
  width: 18px;
  height: 18px;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%234285F4" d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"/><path fill="%2334A853" d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"/><path fill="%23FBBC05" d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"/><path fill="%23EA4335" d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"/></svg>') center/contain no-repeat;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--auth-muted);
  margin: 24px 0;
  font-size: 14px;
}

.divider:before, .divider:after {
  content: "";
  height: 1px;
  background: var(--auth-line);
  flex: 1;
}

.auth-bottom {
  color: var(--auth-muted);
  font-size: 14px;
  margin: 20px 0 0;
  text-align: center;
}

.auth-resend-confirmation {
  align-items: center;
  color: var(--auth-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 14px;
  gap: 12px;
  justify-content: center;
  margin: 20px 0 18px;
  text-align: center;
  width: 100%;
}

.auth-resend-confirmation__button {
  height: 40px;
  padding: 0 18px;
}

.auth-hint {
  color: var(--auth-muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 16px 0 0;
  text-align: center;
}

.auth-icon {
  display: block;
  margin: 0 auto;
}

.validation-summary-errors {
  background: var(--auth-danger-bg);
  border: 1px solid var(--auth-danger-border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 20px;
  color: var(--auth-error);
  font-size: 14px;
}

.validation-summary-errors ul {
  margin: 0;
  padding-left: 20px;
}

.auth-visual-section {
  position: relative;
  overflow: hidden;
  background: var(--auth-visual-overlay),
  url('/img/auth-team.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.auth-visual-content {
  position: absolute;
  bottom: 96px;
  left: 0;
  right: 0;
  padding: 0 56px;
  color: var(--auth-media-heading);
  max-width: 620px;
}

.auth-visual-content h2 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  line-height: 1.1;
  color: var(--auth-media-heading);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.auth-visual-content p {
  color: var(--auth-media-text);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 24px;
  max-width: 520px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

.auth-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-indicators span {
  background: var(--auth-media-badge-bg);
  border: 1px solid var(--auth-media-badge-border);
  border-radius: 999px;
  color: var(--auth-media-badge-text);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-form-section {
    border-right: none;
  }

  .auth-visual-section {
    display: none;
  }

  .auth-form-wrapper {
    padding: 32px 24px;
    min-height: auto;
  }

  .auth-brand {
    margin-bottom: 24px;
  }

  .auth-content {
    justify-content: flex-start;
  }

  .auth-content h1 {
    font-size: 28px;
  }

  .auth-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 640px) {
  .auth-form-wrapper {
    padding: 24px 20px;
  }

  .auth-logo {
    width: 44px;
    height: 44px;
  }

  .auth-content h1 {
    font-size: 24px;
  }

  .auth-supporting {
    font-size: 14px;
  }

  .btn {
    height: 44px;
    font-size: 14px;
  }

  .field input {
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Register page compact styling */
.auth-page--register .auth-form-wrapper {
  padding: 32px 48px 24px;
}

.auth-page--register .auth-brand {
  margin-bottom: 20px;
}

.auth-page--register .auth-logo {
  width: 46px;
  height: 46px;
}

.auth-page--register .auth-content h1 {
  font-size: 30px;
  margin-bottom: 6px;
}

.auth-page--register .auth-supporting {
  font-size: 14px;
  margin-bottom: 20px;
}

.auth-page--register .field {
  margin: 12px 0;
}

.role-choice {
  margin: 0 0 12px;
}

.role-choice__options {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 48px;
}

.role-option {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 7px;
  min-height: 28px;
}

.role-option input {
  accent-color: var(--auth-primary);
  height: 16px;
  width: 16px;
  flex: 0 0 auto;
  margin: 0;
}

.role-option span {
  color: var(--auth-text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
}

.auth-page--register .field label {
  font-size: 13px;
}

.auth-page--register .field input {
  height: 44px;
  padding: 0 14px;
}

.auth-page--register .check {
  margin: 4px 0;
}

.auth-page--register .btn {
  height: 44px;
}

.auth-page--register .auth-form {
  margin-bottom: 16px;
}

.auth-page--register .divider {
  margin: 16px 0;
}

.auth-page--register .auth-bottom {
  margin: 12px 0 0;
}

/* Laptop-height specific adjustments for Register page */
@media (min-width: 901px) and (max-height: 850px) {
  .auth-page--register .auth-form-wrapper {
    padding: 24px 48px 20px;
  }

  .auth-page--register .auth-logo {
    width: 44px;
    height: 44px;
  }

  .auth-page--register .auth-brand {
    margin-bottom: 16px;
  }

  .auth-page--register .auth-content h1 {
    font-size: 28px;
    margin-bottom: 4px;
  }

  .auth-page--register .auth-supporting {
    margin-bottom: 16px;
  }

  .auth-page--register .field {
    margin: 10px 0;
  }

  .auth-page--register .check {
    margin: 2px 0;
  }

  .auth-page--register .auth-form {
    margin-bottom: 12px;
  }

  .auth-page--register .divider {
    margin: 12px 0;
  }

  .auth-page--register .auth-bottom {
    margin: 8px 0 0;
  }
}

.auth-status {
  background: var(--auth-success-bg);
  border: 1px solid var(--auth-success-border);
  border-radius: 12px;
  color: var(--auth-success);
  font-size: 14px;
  margin-bottom: 20px;
  padding: 12px;
}

.auth-resend-form {
  align-items: center;
  display: flex;
  justify-content: center;
  margin-top: -4px;
}

.auth-link-button {
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.role-picker {
  align-items: center;
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  justify-content: center;
  margin: 16px 0 20px;
  padding: 0;
}

.role-option {
  align-items: center;
  color: var(--auth-text);
  cursor: pointer;
  display: inline-flex;
  gap: 10px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
}

.role-option input {
  accent-color: var(--auth-primary);
  cursor: pointer;
  height: 20px;
  margin: 0;
  width: 20px;
}

.role-option span {
  color: var(--auth-text);
}


.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.theme-toggle {
  align-items: center;
  background: var(--theme-toggle-bg);
  border: 1px solid var(--theme-toggle-border);
  border-radius: 999px;
  box-shadow: var(--theme-toggle-shadow);
  color: var(--auth-primary-hover);
  cursor: pointer;
  display: inline-flex;
  height: 44px;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  position: fixed;
  right: 28px;
  top: 28px;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  width: 44px;
  z-index: 10;
}

.theme-toggle:hover {
  background: var(--theme-toggle-bg-hover);
  border-color: var(--auth-line-amber);
  box-shadow: 0 14px 34px rgba(245, 166, 35, 0.16);
}

.theme-toggle:active { box-shadow: 0 8px 18px rgba(245, 166, 35, 0.12); }
.theme-toggle:focus-visible { outline: 3px solid rgba(245, 166, 35, 0.36); outline-offset: 3px; }
.theme-toggle__icon { height: 20px; width: 20px; }
.theme-toggle__icon--moon { display: none; }
:root[data-theme="light"] .theme-toggle__icon--sun { display: none; }
:root[data-theme="light"] .theme-toggle__icon--moon { display: block; }

@media (max-width: 900px) { .theme-toggle { right: 20px; top: 20px; } .auth-brand { padding-right: 58px; } }
@media (max-width: 420px) { .theme-toggle { right: 14px; top: 14px; } }
