/* =============================================
   RITAJ HOSPITAL — PATIENT PORTAL AUTH PAGES
   Shared styles for login, register, forgot
   password and reset password.
   ============================================= */

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

:root {
  --primary: #1a7a3c;
  --primary-dark: #145e2e;
  --primary-light: #2fa860;
  --primary-glow: rgba(26, 122, 60, 0.35);

  --bg-primary: #f8faf9;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f3;
  --bg-elevated: #ffffff;
  --bg-hover: #e8f5ed;
  --bg-active: #dcefe3;

  --text-primary: #1a2e22;
  --text-secondary: #2d5a3d;
  --text-muted: #5a7a65;
  --text-disabled: #a9c2b0;

  --border: rgba(26, 122, 60, 0.15);
  --border-light: rgba(26, 122, 60, 0.22);
  --border-focus: var(--primary);

  --success: #22c55e;
  --warning: #eab308;
  --error: #c0392b;
  --info: #3b82f6;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(26, 122, 60, 0.08);
  --shadow-md: 0 4px 20px rgba(26, 122, 60, 0.12);
  --shadow-lg: 0 10px 40px rgba(26, 122, 60, 0.18);
  --shadow-glow: 0 0 40px var(--primary-glow);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
}

/* ── Reset & base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-active); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

a { color: inherit; text-decoration: none; transition: color var(--transition-fast); }

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

/* ── Form elements ── */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.form-input:hover {
  border-color: var(--border-light);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 122, 60, 0.15);
}

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

.form-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.form-check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
}

.form-check-row input[type="checkbox"] {
  margin-top: 5px;
  accent-color: var(--primary);
}

.form-check-row label {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.form-check-row label a {
  color: var(--primary);
  text-decoration: none;
}

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

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition-fast);
}

.input-icon:hover {
  color: var(--text-primary);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.875rem; }

/* ── Alert messages ── */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.alert.show { display: flex; }

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #c0392b;
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #1a7a3c;
}

/* ── Spinner ── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

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

/* ── Auth page shell ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8f5ed 0%, #ffffff 55%, #f8faf9 100%);
  padding: 20px;
  position: relative;
}

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

.auth-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header img {
  height: 56px;
  object-fit: contain;
  margin-bottom: 10px;
  border-radius: 10px;
}

.auth-logo {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.auth-logo .x {
  color: var(--primary);
}

.auth-tagline {
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.auth-title {
  margin-bottom: 28px;
}

.auth-title h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.auth-title p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.forgot-link {
  display: inline-block;
  color: var(--primary);
  font-size: 0.875rem;
  margin-bottom: 20px;
  transition: color var(--transition-fast);
}

.forgot-link:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.auth-footer a {
  color: var(--primary);
  font-weight: 600;
  transition: color var(--transition-fast);
}

.auth-footer a:hover {
  color: var(--primary-light);
}

/* ── Language toggle button (auth pages only; dashboard.html has its own nav-integrated version) ── */
.lang-toggle-auth {
  position: absolute;
  top: 20px;
  inset-inline-end: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--primary);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  font-family: inherit;
}

.lang-toggle-auth:hover {
  background: var(--bg-hover);
}

@media (max-width: 480px) {
  .auth-card {
    padding: 36px 28px;
  }

  .auth-logo {
    font-size: 1.3rem;
  }

  .auth-title h1 {
    font-size: 1.5rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}
