/* ===== AUTH PAGES — RentaGo Design System ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,0..200&display=swap');

:root {
  --green: #22d55c;
  --green-hover: #54e683;
  --green-light: #d1fae5;
  --green-dark: #15803d;
  --dark: #111827;
  --dark-teal: #006d6d;
  --dark-teal-hover: #005a5a;
  --text: #1f2937;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --bg-page: #f6f8f6;
  --bg-white: #ffffff;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 9999px;
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

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

html, body {
  height: 100%;
}

body.auth-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-page);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

button, input, select, textarea {
  font-family: inherit;
}

/* ===== AUTH HEADER ===== */
.auth-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.auth-header .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-header-logo img {
  height: 32px;
  width: auto;
}

.auth-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.auth-header-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  transition: color 0.2s;
}

.auth-header-link:hover {
  color: var(--green-dark);
}

.auth-header-btn {
  display: inline-block;
  padding: 10px 22px;
  background: var(--dark);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  transition: background 0.2s;
}

.auth-header-btn:hover {
  background: #1f2937;
}

/* ===== AUTH LAYOUT ===== */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 65px);
  padding: 40px 24px 60px;
}

.auth-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  width: 100%;
  max-width: 440px;
  padding: 40px 36px 36px;
}

.auth-card.wide {
  max-width: 720px;
  padding: 40px 40px 36px;
}

.auth-card-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.auth-card-logo img {
  height: 40px;
  width: auto;
}

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

.auth-card-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.auth-card-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== TAB SWITCHER ===== */
.auth-tabs {
  display: flex;
  background: var(--border-light);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active {
  background: var(--bg-white);
  color: var(--dark);
  box-shadow: var(--shadow-sm);
}

.auth-tab:hover:not(.active) {
  color: var(--text);
}

/* ===== FORM ===== */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.form-group label .required {
  color: #ef4444;
  margin-left: 2px;
}

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

.form-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text);
  background: var(--bg-white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(34, 213, 92, 0.15);
}

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

.form-input.has-icon-right {
  padding-right: 48px;
}

.toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

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

.toggle-password .material-symbols-outlined {
  font-size: 20px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

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

.btn-submit {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--dark);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}

.btn-submit:hover {
  background: #1f2937;
}

.btn-submit .material-symbols-outlined {
  font-size: 20px;
}

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

.auth-switch a {
  font-weight: 700;
  color: var(--dark);
  transition: color 0.2s;
}

.auth-switch a:hover {
  color: var(--green-dark);
}

.auth-footer {
  text-align: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-light);
}

.auth-footer a {
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s;
}

.auth-footer a:hover {
  color: var(--green-dark);
}

/* SMS panel hidden by default */
.auth-panel {
  display: none;
}

.auth-panel.active {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ===== REGISTRATION SECTIONS ===== */
.form-section {
  margin-bottom: 28px;
}

.form-section:last-of-type {
  margin-bottom: 8px;
}

.form-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

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

.form-grid .form-group.full {
  grid-column: 1 / -1;
}

.auth-form-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-forgot-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark-teal);
}

.auth-forgot-link:hover {
  color: var(--dark-teal-hover);
  text-decoration: underline;
}

.auth-notice {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
}

.auth-notice.error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.auth-notice.success {
  background: #ecfdf5;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.auth-notice.info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.auth-notice.warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.auth-notice.warning p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.5;
}

.auth-resend-form {
  margin-bottom: 24px;
}

.btn-submit-secondary {
  background: #006d6d;
}

.btn-submit-secondary:hover {
  background: #005a5a;
}

.role-select {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.role-select label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.role-select input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
  flex-shrink: 0;
}

.auth-terms-link {
  color: var(--green-dark);
  font-weight: 600;
}

.auth-terms-link:hover {
  color: var(--green);
}

.password-match-group {
  margin-top: -4px;
}

.password-match-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}

.password-match-status.is-match {
  color: var(--green-dark);
}

.password-match-status.is-mismatch {
  color: #b91c1c;
}

.password-match-status .material-symbols-outlined {
  font-size: 18px;
}

.person-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.person-type-option {
  display: block;
  cursor: pointer;
}

.person-type-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.person-type-option-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.person-type-option-card strong {
  font-size: 14px;
  color: var(--dark);
}

.person-type-option-card small {
  font-size: 12px;
  color: var(--text-muted);
}

.person-type-option input:checked + .person-type-option-card {
  border-color: var(--green);
  background: #f0fdf4;
  box-shadow: 0 0 0 3px rgba(34, 213, 92, 0.12);
}

.field-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

@media (max-width: 640px) {
  .person-type-toggle {
    grid-template-columns: 1fr;
  }
}

.form-input.password-match {
  border-color: var(--green);
}

.form-input.password-match:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(34, 213, 92, 0.15);
}

.form-input.password-mismatch {
  border-color: #ef4444;
}

.form-input.password-mismatch:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .auth-card,
  .auth-card.wide {
    padding: 32px 24px 28px;
  }

  .auth-card-title {
    font-size: 24px;
  }

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

  .auth-header-actions .auth-header-link {
    display: none;
  }
}
