/* === Auth Pages — InfinitumJobs === */

:root {
  --primary: #055CB4;
  --primary-hover: #044a93;
  --primary-light: #eef4fb;
  --primary-dark: #020360;
  --accent: #11D15E;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --warning: #ca8a04;
  --warning-bg: #fefce8;
  --text: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #d1d5db;
  --border-focus: #055CB4;
  --bg: #f4f5f7;
  --card-bg: #ffffff;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* === Layout === */
.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
}

.auth-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 420px;
  padding: 40px 32px;
}

/* === Logo === */
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo a {
  display: inline-block;
  text-decoration: none;
}

.auth-logo img {
  height: 48px;
  width: auto;
}

/* === Headings === */
.auth-title {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 4px;
  color: var(--text);
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 28px;
}

/* === OAuth buttons === */
.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
}

.btn-oauth:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.btn-oauth svg { width: 20px; height: 20px; flex-shrink: 0; }

.btn-oauth.btn-apple { background: #000; color: #fff; border-color: #000; }
.btn-oauth.btn-apple:hover { background: #1a1a1a; }

/* === Separator === */
.auth-separator {
  display: flex;
  align-items: center;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-separator::before,
.auth-separator::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

.auth-separator span { padding: 0 12px; }

/* === Form elements === */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: var(--font);
  color: var(--text);
  background: var(--card-bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 13px;
  color: var(--danger);
  margin-top: 4px;
  display: none;
}

.form-error.visible { display: block; }

/* === Password field === */
.password-wrapper {
  position: relative;
}

.password-wrapper .form-input { padding-right: 44px; }

.btn-toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  font-size: 18px;
}

/* === Password strength === */
.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.strength-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #e5e7eb;
  transition: background 0.3s;
}

.strength-bar.weak { background: var(--danger); }
.strength-bar.fair { background: #f97316; }
.strength-bar.good { background: var(--warning); }
.strength-bar.strong { background: #22c55e; }
.strength-bar.very-strong { background: var(--success); }

.strength-label {
  font-size: 12px;
  margin-top: 4px;
  color: var(--text-muted);
}

/* === Checkboxes === */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}

.checkbox-group input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.checkbox-group label {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.checkbox-group label a {
  color: var(--primary);
  text-decoration: none;
}

.checkbox-group label a:hover { text-decoration: underline; }

/* === Buttons === */
.btn {
  width: 100%;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-secondary:hover:not(:disabled) { background: var(--primary-light); }

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  width: auto;
}

.btn-link:hover { text-decoration: underline; }

/* === Loading spinner === */
.btn.loading {
  position: relative;
  color: transparent !important;
}

.btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === Alert messages === */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 20px;
  display: none;
}

.alert.visible { display: block; }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #bbf7d0; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid #fef08a; }
.alert-info { background: var(--primary-light); color: var(--primary); border: 1px solid #bfdbfe; }

/* === Links === */
.auth-links {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-links a:hover { text-decoration: underline; }

/* === Footer === */
.auth-footer {
  text-align: center;
  margin-top: 24px;
  max-width: 420px;
}

.auth-legal {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.auth-legal a {
  color: var(--text-muted);
  text-decoration: none;
}

.auth-legal a:hover { text-decoration: underline; }
.auth-legal .separator { margin: 0 6px; }

.lang-selector {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.lang-selector a {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 4px;
}

.lang-selector a.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

.lang-selector a:hover { color: var(--primary); }

.copyright {
  font-size: 11px;
  color: var(--text-muted);
}

/* === Success screen (verification) === */
.success-icon {
  text-align: center;
  margin-bottom: 20px;
}

.success-icon svg {
  width: 64px;
  height: 64px;
  color: var(--success);
}

/* === reCAPTCHA v2 container === */
.recaptcha-v2-container {
  display: none;
  margin: 16px 0;
}

.recaptcha-v2-container.visible { display: flex; justify-content: center; }

/* === Responsive === */
@media (max-width: 480px) {
  .auth-card { padding: 32px 20px; }
  .auth-container { padding: 16px 12px; }
}

/* === Check Email State === */
.check-email-state {
  text-align: center;
  padding: 16px 0;
}

.check-email-icon {
  margin-bottom: 20px;
}

.check-email-icon svg {
  width: 72px;
  height: 72px;
  color: var(--primary);
}

.check-email-email {
  font-weight: 600;
  color: var(--primary-dark);
  word-break: break-all;
}

.check-email-tips {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 16px;
  line-height: 1.6;
}

.resend-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.resend-counter {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-resend-small {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13px;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-resend-small:hover:not(:disabled) {
  background: var(--primary-light);
  border-color: var(--primary);
}

.btn-resend-small:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cooldown-timer {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* === Inline link button === */
.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
  padding: 0;
}

.btn-link:hover { color: var(--primary-hover); }

