/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --green-100: #dcfce7;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --blue-500:  #3b82f6;
  --red-500:   #ef4444;
  --red-100:   #fee2e2;
  --gray-50:   #f9fafb;
  --gray-100:  #f3f4f6;
  --gray-200:  #e5e7eb;
  --gray-300:  #d1d5db;
  --gray-400:  #9ca3af;
  --gray-500:  #6b7280;
  --gray-600:  #4b5563;
  --gray-700:  #374151;
  --gray-800:  #1f2937;
  --gray-900:  #111827;
  --white:     #ffffff;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow:    0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
}

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.5;
  min-height: 100vh;
}

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

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gray-900);
}

.logo-icon { font-size: 1.4rem; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-signin-text {
  font-size: 0.875rem;
  color: var(--gray-500);
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  font-family: var(--font);
  transition: opacity 0.15s, transform 0.1s;
  background: none;
}

.btn-ghost {
  color: var(--white);
  background-color: var(--green-600);
}

.btn-ghost:hover {
  opacity: 0.8;
}

/* =============================================
   MAIN
   ============================================= */
.main {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* =============================================
   FORM CARD
   ============================================= */
.form-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow);
}

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

.form-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.form-sub {
  font-size: 0.95rem;
  color: var(--gray-500);
}

/* =============================================
   ROLE SELECTION
   ============================================= */
.role-section {
  margin-bottom: 28px;
}

.role-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 12px;
}

.role-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.role-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: var(--white);
  cursor: pointer;
  font-family: var(--font);
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.role-btn:hover {
  border-color: var(--green-500);
  background: var(--green-100);
  transform: translateY(-1px);
}

.role-btn-active {
  border-color: var(--green-600);
  background: var(--green-100);
}

.role-btn-icon {
  font-size: 1.8rem;
}

.role-btn-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
}

.role-btn-sub {
  font-size: 0.78rem;
  color: var(--gray-500);
}

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

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

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

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
}

.form-input {
  padding: 11px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--gray-800);
  font-family: var(--font);
  background: var(--white);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input::placeholder {
  color: var(--gray-400);
}

.form-input:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* =============================================
   ERROR MESSAGE
   ============================================= */
.form-error {
  background: var(--red-100);
  color: var(--red-500);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: var(--radius);
}

/* =============================================
   SUBMIT BUTTON
   ============================================= */
.btn-submit {
  width: 100%;
  padding: 14px;
  background: var(--green-600);
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-family: var(--font);
  transition: opacity 0.15s, transform 0.1s;
}

.btn-submit:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

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

/* =============================================
   LOGIN MODAL
   ============================================= */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.modal-open {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: #fee2e2;
  border-radius: 50%;
  font-size: 0.8rem;
  cursor: pointer;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  transition: background 0.15s;
}

.modal-close:hover {
  background: #fecaca;
}

.modal-header {
  margin-bottom: 24px;
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.modal-sub {
  font-size: 0.875rem;
  color: var(--gray-500);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.modal-footer-text {
  text-align: center;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.modal-link {
  color: var(--green-600);
  font-weight: 600;
}

.modal-link:hover {
  text-decoration: underline;
}

/* =============================================
   MOBILE (max-width: 768px)
   ============================================= */
@media (max-width: 768px) {
  /* Navbar */
  .navbar-inner {
    padding: 0 16px;
  }

  .nav-signin-text {
    display: none;
  }

  /* Main */
  .main {
    padding: 24px 16px 60px;
  }

  /* Form card */
  .form-card {
    padding: 24px 16px;
    border-radius: var(--radius-lg);
  }

  .form-title {
    font-size: 1.4rem;
  }

  /* Form rows — stack to single column */
  .form-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Modal */
  .modal {
    padding: 28px 20px;
  }
}
