﻿@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

body {
  font-family: 'Poppins', sans-serif;
  background:
    radial-gradient(900px circle at 0% 0%, rgba(249, 115, 22, 0.12), transparent 55%),
    radial-gradient(900px circle at 100% 0%, rgba(59, 130, 246, 0.12), transparent 55%),
    var(--c-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 24px;
  color: var(--c-fg);
}

body.dark-mode {
  background: hsl(220 40% 10%);
}

.auth-shell {
  width: 100%;
  max-width: 850px;
  position: relative;
}

.theme-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--c-border);
  background: var(--c-card);
  color: var(--c-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--c-accent);
  color: var(--c-accent);
}

.custom-card {
  width: 100%;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 14px 45px rgba(12, 22, 40, 0.1);
  backdrop-filter: blur(8px);
}

body.dark-mode .custom-card {
  box-shadow: 0 16px 50px rgba(2, 8, 20, 0.45);
}

h1 {
  margin: 0;
  text-align: center;
  font-size: 28px;
  line-height: 1.1;
  color: var(--c-fg);
}

.subtitle {
  text-align: center;
  margin: 10px 0 20px;
  color: var(--c-muted-fg);
  font-size: 14px;
}

.field {
  position: relative;
  margin-bottom: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.role-switch-container {
  position: relative;
  display: flex;
  width: 300px;
  background: var(--c-secondary);
  border: 1px solid var(--c-border);
  border-radius: 50px;
  padding: 5px;
  margin: 0 auto 20px;
}

.role-slider {
  position: absolute;
  top: 5px;
  left: 5px;
  width: calc(50% - 5px);
  height: calc(100% - 10px);
  border-radius: 50px;
  background: linear-gradient(135deg, #f97316, #ea580c);
  transition: transform 0.25s ease;
}

.role-option {
  position: relative;
  z-index: 1;
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--c-muted-fg);
  height: 38px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease;
}

.role-option.active {
  color: #fff;
}

.field .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.field input,
.field select {
  width: 100%;
  height: 50px;
  border-radius: 12px;
  border: 1px solid var(--c-border);
  background: var(--c-secondary);
  color: var(--c-fg);
  font-size: 14px;
  padding: 12px 15px 12px 42px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  appearance: none;
}

.field select {
  padding-right: 44px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%), linear-gradient(135deg, #94a3b8 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 12px) 20px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.field select option {
  background: #0f1e3b;
  color: #e5e7eb;
}

.field select option[value="male"] {
  color: #93c5fd;
}

.field select option[value="female"] {
  color: #f9a8d4;
}

body:not(.dark-mode) .field select option {
  background: #ffffff;
  color: #334155;
}

body:not(.dark-mode) .field select option[value="male"] {
  color: #1d4ed8;
}

body:not(.dark-mode) .field select option[value="female"] {
  color: #be185d;
}

.field input:focus,
.field select:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.14);
  background: var(--c-card);
}

.field input:focus~.icon,
.field select:focus~.icon {
  color: var(--c-accent);
}

body.dark-mode .field input,
body.dark-mode .field select {
  background: #0f1e3b;
  color: #e5e7eb;
}

body.dark-mode .field input:focus,
body.dark-mode .field select:focus {
  background: #13264a;
}

body.dark-mode .field input::placeholder {
  color: #9aa9c0;
}

body.dark-mode .field input:-webkit-autofill,
body.dark-mode .field input:-webkit-autofill:hover,
body.dark-mode .field input:-webkit-autofill:focus,
body.dark-mode .field input:-webkit-autofill:active {
  -webkit-text-fill-color: #e5e7eb;
  -webkit-box-shadow: 0 0 0 1000px #0f1e3b inset;
  box-shadow: 0 0 0 1000px #0f1e3b inset;
  caret-color: #e5e7eb;
  transition: background-color 9999s ease-in-out 0s;
}

.btn-custom-primary {
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: 0 5px 15px rgba(249, 115, 22, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-custom-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(249, 115, 22, 0.45);
}

.small {
  margin: 18px 0 0;
  text-align: center;
  color: var(--c-muted-fg);
  font-size: 13px;
}

.small a {
  color: var(--c-accent);
  text-decoration: none;
  font-weight: 600;
}

.full-row {
  grid-column: 1 / -1;
}

.custom-alert {
  position: relative;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #b91c1c;
  font-size: 13px;
  padding: 10px 34px 10px 12px;
  margin-bottom: 16px;
  display: none;
}

.custom-alert.show {
  display: block;
}

.custom-alert.alert-success {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.alert-close-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
}

.fade-up {
  animation: fadeUp 0.5s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .role-switch-container {
    width: 100%;
  }

  .custom-card {
    padding: 40px 20px 24px;
    border-radius: 16px;
  }

  h1 {
    font-size: 26px;
  }
}

/* Light-mode colors only */
body:not(.dark-mode) {
  background: #d1d3d6;
}

body:not(.dark-mode) .custom-card {
  background: linear-gradient(135deg, #ece5df, #e8ddd4);
  border: 1px solid #d5c7bc;
  box-shadow: 0 24px 45px rgba(0, 0, 0, 0.16);
}

body:not(.dark-mode) h1 {
  color: #f97316;
  font-weight: 700;
}

body:not(.dark-mode) .field input,
body:not(.dark-mode) .field select {
  background: #ececec;
  border: 1px solid #c7cbd3;
  color: #6b7280;
}

body:not(.dark-mode) .field .icon {
  color: #9ca3af;
}

body:not(.dark-mode) .role-switch-container {
  background: #d8dde4;
  border-color: #c6ccd5;
}

body:not(.dark-mode) .role-option {
  color: #6b7280;
}

body:not(.dark-mode) .role-option.active {
  color: #fff;
}

body:not(.dark-mode) .btn-custom-primary {
  background: linear-gradient(135deg, #ff6a00, #ff8c3a);
  box-shadow: 0 8px 22px rgba(255, 106, 0, 0.3);
}

body:not(.dark-mode) .small {
  color: #6b7280;
}

body:not(.dark-mode) .small a {
  color: #ff6a00;
}
