/* Page styles for auth.html */
.top-bar {
  height: 4px;
  background: linear-gradient(90deg, #1D2C51, #2563EB);
}


:root {
  --primary: #1E3A8A;
  --primary-dark: #1D4ED8;
  --primary-light: #E6F1FF;
  --foreground: #1f2937;
  --muted: #6b7280;
  --background: #f9fafb;
  --card: #ffffff;
  --border: #e5e7eb;
  --secondary: #f3f4f6;
  --destructive: #dc2626;
  --success: #059669;
  --success-bg: #D1FAE5;
}

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

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  min-height: 100vh;
}

/* Layout */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.logo-icon svg {
  width: 16px;
  height: 16px;
  color: white;
}

.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.auth-container {
  width: 100%;
  max-width: 420px;
}

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 5px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 16px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  transition: all 0.2s;
  position: relative;
  font-family: inherit;
}

.tab:hover {
  color: var(--foreground);
  background: var(--secondary);
}

.tab.active {
  color: var(--primary);
  background: transparent;
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

/* Form */
.form-content {
  padding: 28px;
}

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

.form-group:last-of-type {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--foreground);
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--card);
  color: var(--foreground);
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
  color: #9ca3af;
}

.form-input-icon {
  position: relative;
}

.form-input-icon svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.form-input-icon input {
  padding-left: 44px;
}

.form-hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

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

.password-toggle:hover {
  color: var(--foreground);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  position: static;
  transform: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  font-family: inherit;
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn svg {
  width: 18px;
  height: 18px;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  font-size: 13px;
  color: var(--muted);
}

/* Organisation Verification Section */
.verify-section {
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  border-radius: 5px;
  padding: 16px;
  margin-top: 8px;
}

.verify-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.verify-section-header svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.verify-section-header h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}

.verify-section p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.btn-verify {
  background: white;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-verify:hover {
  background: var(--primary);
  color: white;
}

.btn-verify svg {
  width: 14px;
  height: 14px;
}

/* Error Notice */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 5px;
  margin-bottom: 20px;
}

.notice-error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
}

.notice-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--destructive);
}

.notice-text {
  font-size: 14px;
  color: var(--foreground);
}

.hidden {
  display: none !important;
}

/* Footer link */
.form-footer {
  text-align: center;
  padding: 20px 28px;
  background: var(--secondary);
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
}

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

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

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--foreground);
  color: white;
  padding: 14px 20px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: var(--success);
}

.toast-error {
  background: var(--destructive);
}

/* Checkbox */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

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

.checkbox-group label {
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}

.checkbox-group label a {
  color: var(--primary);
  text-decoration: none;
}

.checkbox-group label a:hover {
  text-decoration: underline;
}

/* Password strength */
.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.strength-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  transition: background 0.2s;
}

.strength-bar.weak {
  background: #EF4444;
}

.strength-bar.medium {
  background: #F59E0B;
}

.strength-bar.strong {
  background: #10B981;
}

.strength-text {
  font-size: 12px;
  margin-top: 6px;
  color: var(--muted);
}

/* Mobile */
@media (max-width: 480px) {
  .main {
    padding: 24px 16px;
  }

  .form-content {
    padding: 24px 20px;
  }

  .form-footer {
    padding: 16px 20px;
  }
}

/* Prevent iOS Safari zoom on input focus (must be ≥16px) */
input:not([type=checkbox]):not([type=radio]):not([type=range]),
textarea,
select {
  font-size: max(16px, 1em);
}