:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --secondary: #f97316;
  --teal: #14b8a6;
  --pink: #ec4899;
  --surface: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-sec: #475569;
  --text-muted: #94a3b8;
  --green: #22c55e;
  --red: #ef4444;
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 30%, #fff1f2 60%, #fff7ed 100%);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

h1, h2, h3, h4, h5 {
  font-family: 'Nunito', system-ui, sans-serif;
}

.auth-wrapper {
  width: 100%;
  max-width: 460px;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
  text-decoration: none;
  color: var(--text);
}

.auth-logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25);
}

.auth-logo-text {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 22px;
}

.auth-card {
  background: #fff;
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06);
  padding: 40px 36px;
  animation: cardEntry .4s ease;
}

@keyframes cardEntry {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-card h2 {
  font-size: 26px;
  font-weight: 900;
  text-align: center;
  margin-bottom: 6px;
}

.auth-card .subtitle {
  text-align: center;
  color: var(--text-sec);
  font-size: 15px;
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 13px 16px;
  border-radius: 14px;
  border: 2px solid var(--border);
  font-size: 15px;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
  background: #fafaff;
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-group .input-wrapper {
  position: relative;
}

.form-group .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  pointer-events: none;
}

.form-group .input-wrapper input {
  padding-left: 42px;
}

.form-group .toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
}

.form-group .toggle-password:hover {
  color: var(--text-sec);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.form-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sec);
  cursor: pointer;
}

.form-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-row a {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.form-row a:hover {
  text-decoration: underline;
}

.btn-submit {
  width: 100%;
  padding: 15px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Inter', system-ui, sans-serif;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.3);
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-submit:hover {
  box-shadow: 0 10px 32px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

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

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-submit .spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: none;
}

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

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

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

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-sec);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.auth-bottom {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-muted);
}

.alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 18px;
  display: none;
  align-items: center;
  gap: 8px;
}

.alert.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  display: flex;
}

.alert.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
  display: flex;
}

.role-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.role-option {
  position: relative;
}

.role-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.role-option label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  border-radius: 16px;
  border: 2px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.role-option label:hover {
  border-color: var(--primary-light);
  background: rgba(99, 102, 241, 0.02);
}

.role-option input:checked + label {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.04);
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.12);
}

.role-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--surface);
  transition: all 0.2s;
}

.role-option input:checked + label .role-icon {
  background: var(--primary);
}

.role-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.role-option input:checked + label .role-label {
  color: var(--primary);
}

.role-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.role-option input:checked ~ .role-check {
  display: flex;
}

.password-strength {
  margin-top: 8px;
  height: 4px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  border-radius: 4px;
  transition: all 0.3s;
  width: 0%;
}

.password-strength-text {
  font-size: 11px;
  margin-top: 4px;
  font-weight: 500;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4ade80, var(--teal));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 20px;
  box-shadow: 0 8px 30px rgba(20, 184, 166, 0.3);
}

@media (max-width: 480px) {
  .auth-card {
    padding: 28px 20px;
  }
  .role-selector {
    grid-template-columns: 1fr;
  }
}
