*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #1a56db;
  --blue-light: #e8f0fe;
  --blue-dark: #1240a8;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f9fafb;
  --white: #ffffff;
  --error: #dc2626;
  --success: #16a34a;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  position: relative;
  overflow-x: hidden;
}

.bg-pattern {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(26,86,219,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(26,86,219,0.05) 0%, transparent 60%);
  pointer-events: none;
}

.auth-container {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  justify-content: center;
  margin-bottom: 2rem;
}

.brand-icon { display: flex; align-items: center; }
.brand-name {
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  color: var(--text);
  letter-spacing: -0.3px;
}

.auth-tabs {
  display: flex; gap: 4px;
  background: var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 1.5rem;
}

.auth-tab {
  flex: 1; padding: 8px 0;
  border: none; background: transparent;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s;
}

.auth-tab.active {
  background: var(--white);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.auth-form {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.form-header { margin-bottom: 1.5rem; }
.form-header h1 {
  font-family: 'DM Serif Display', serif;
  font-size: 26px;
  color: var(--text);
  margin-bottom: 4px;
}
.form-header p { font-size: 14px; color: var(--text-muted); }

.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 13px; font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.field input {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; color: var(--text);
  background: var(--white);
  transition: border-color 0.15s;
  outline: none;
}
.field input:focus { border-color: var(--blue); }
.field input::placeholder { color: var(--text-muted); }

.role-selector {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 1.25rem;
}
.role-option {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
.role-option:hover { border-color: var(--blue); background: var(--blue-light); }
.role-option.active { border-color: var(--blue); background: var(--blue-light); }
.role-icon { font-size: 22px; margin-bottom: 4px; }
.role-label { font-size: 13px; font-weight: 600; color: var(--text); }
.role-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.btn-primary {
  width: 100%; padding: 12px;
  background: var(--blue);
  color: white;
  border: none; border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px; font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  position: relative; height: 44px;
  display: flex; align-items: center; justify-content: center;
  margin-top: 0.5rem;
}
.btn-primary:hover { background: var(--blue-dark); }

.btn-google {
  width: 100%; padding: 10px;
  background: white;
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: background 0.15s;
  margin-top: 0.75rem;
}
.btn-google:hover { background: var(--bg); }

.divider {
  text-align: center; position: relative;
  margin: 1rem 0 0;
  color: var(--text-muted); font-size: 12px;
}
.divider::before {
  content: '';
  position: absolute; top: 50%; left: 0; right: 0;
  height: 1px; background: var(--border);
  z-index: 0;
}
.divider span {
  position: relative; z-index: 1;
  background: white; padding: 0 12px;
}

.error-msg {
  font-size: 13px; color: var(--error);
  background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 6px; padding: 8px 12px;
  margin-bottom: 10px;
}

.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  position: absolute;
}
@keyframes spin { to { transform: rotate(360deg); } }

.footer-note {
  text-align: center; font-size: 12px;
  color: var(--text-muted); margin-top: 1.5rem;
}

@media (max-width: 480px) {
  .auth-form { padding: 1.5rem; }
}
