/* =============================================================================
   style.css — GUVI Internship Project
   Design language: minimal monochrome, typography-led, studio aesthetic.
   Black / white / grey only. Thin rules instead of shadows. No gradients.
============================================================================= */

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

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --black:     #0a0a0a;
  --ink:       #171717;
  --ink-2:     #404040;
  --ink-3:     #737373;
  --ink-4:     #a3a3a3;
  --rule:      #e5e5e5;
  --rule-dark: #d4d4d4;
  --surface:   #ffffff;
  --bg:        #fafafa;

  --red:   #b91c1c;
  --green: #166534;

  --radius-sm: 3px;
  --radius-md: 4px;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
}

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

html { font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--black);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* Shared small caps label used everywhere (eyebrow / numbered steps) */
.label-tag {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ═══════════════════════════════════════════════════════════════════════════
   INDEX / LANDING PAGE
═══════════════════════════════════════════════════════════════════════════ */

.home-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.home-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.75rem 3rem;
  border-bottom: 1px solid var(--rule);
}

.home-nav .nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

.home-nav-links { display: flex; align-items: center; gap: 1.75rem; }

.home-nav .btn-ghost {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: color 0.15s;
}
.home-nav .btn-ghost:hover { color: var(--black); }

.home-nav .btn-solid {
  padding: 0.55rem 1.375rem;
  background: var(--black);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.15s;
}
.home-nav .btn-solid:hover { background: var(--ink); }

/* Hero — split: big type left, numbered flow right */
.home-hero {
  flex: 1;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
  gap: 4rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 5rem 3rem;
  width: 100%;
}

.home-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 5.5vw, 4.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.04;
  color: var(--black);
  margin: 1.25rem 0 1.5rem;
}

.home-hero h1 .rule-break {
  display: block;
  color: var(--ink-4);
}

.home-hero p {
  font-size: 1.0625rem;
  color: var(--ink-3);
  max-width: 460px;
  line-height: 1.7;
  margin-bottom: 2.25rem;
}

.home-hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

.home-hero .cta-primary {
  padding: 0.8125rem 1.875rem;
  background: var(--black);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: background 0.15s;
}
.home-hero .cta-primary:hover { background: var(--ink); }

.home-hero .cta-secondary {
  padding: 0.8125rem 1.875rem;
  background: transparent;
  color: var(--black);
  border: 1px solid var(--rule-dark);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: border-color 0.15s;
}
.home-hero .cta-secondary:hover { border-color: var(--black); }

/* Numbered flow list (right column) */
.home-flow {
  border-left: 1px solid var(--rule);
  padding-left: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.flow-item { display: flex; gap: 1.125rem; align-items: flex-start; }

.flow-item .flow-num {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-4);
  padding-top: 0.2rem;
  flex-shrink: 0;
  width: 1.5rem;
}

.flow-item .flow-text strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 0.25rem;
}

.flow-item .flow-text span {
  font-size: 0.84375rem;
  color: var(--ink-3);
  line-height: 1.6;
}

/* Stack list */
.home-stack {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  gap: 1.25rem 1.75rem;
  flex-wrap: wrap;
}

.stack-badge {
  font-size: 0.78125rem;
  color: var(--ink-4);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.home-footer {
  padding: 1.5rem 3rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--ink-4);
  display: flex;
  justify-content: space-between;
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH PAGES — register.html / login.html
   Centered minimal card, no split panel, thin rule frame
═══════════════════════════════════════════════════════════════════════════ */

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

.auth-topbar {
  padding: 1.75rem 3rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-topbar .nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.back-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--rule-dark);
  border-radius: 50%;
  color: var(--ink-2);
  transition: border-color 0.15s, color 0.15s, transform 0.15s;
  flex-shrink: 0;
}

.back-icon-btn:hover {
  border-color: var(--black);
  color: var(--black);
  transform: translateX(-2px);
}

.auth-topbar .auth-steps {
  display: flex;
  gap: 1.75rem;
}

.auth-step {
  font-size: 0.78125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-step .step-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--rule-dark);
  display: grid;
  place-items: center;
  font-size: 0.625rem;
  font-family: var(--font-display);
  color: var(--ink-4);
}

.auth-step.active { color: var(--black); }
.auth-step.active .step-num {
  background: var(--black);
  border-color: var(--black);
  color: #fff;
}

.auth-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

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

.auth-form-header { margin-bottom: 2.25rem; }

.auth-form-header h1 {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--black);
  margin-bottom: 0.5rem;
}

.auth-form-header p {
  font-size: 0.9rem;
  color: var(--ink-3);
}

/* ── Form controls ──────────────────────────────────────────────────────── */
.field-group { margin-bottom: 1.25rem; }

.field-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 0.5rem;
}

.field-input {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--rule-dark);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--black);
  background: var(--surface);
  transition: border-color 0.15s;
  outline: none;
}

.field-input:focus { border-color: var(--black); }

.field-input.is-invalid { border-color: var(--red); }
.field-input.is-valid { border-color: var(--green); }

.field-error {
  font-size: 0.78125rem;
  color: var(--red);
  margin-top: 0.375rem;
  display: none;
}

.field-input.is-invalid + .field-error { display: block; }

/* ── Alert box ──────────────────────────────────────────────────────────── */
#alert-box {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  display: none;
  border: 1px solid;
}

#alert-box.alert-danger {
  background: #fdf2f2;
  color: var(--red);
  border-color: #f3c5c5;
}

#alert-box.alert-success {
  background: #f1f8f3;
  color: var(--green);
  border-color: #bfdec7;
}

/* ── Primary submit button ──────────────────────────────────────────────── */
.btn-submit {
  width: 100%;
  padding: 0.8125rem 1.25rem;
  background: var(--black);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.btn-submit:hover   { background: var(--ink); }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-submit .spin {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

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

.auth-switch {
  margin-top: 2rem;
  font-size: 0.875rem;
  color: var(--ink-3);
  text-align: center;
}

.auth-switch a { color: var(--black); font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

.or-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink-4);
  font-size: 0.78125rem;
  margin: 1.5rem 0;
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   PROFILE PAGE
═══════════════════════════════════════════════════════════════════════════ */

.profile-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.profile-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  padding: 0 3rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.profile-topbar .topbar-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
}

.topbar-right { display: flex; align-items: center; gap: 1.25rem; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.875rem;
  color: var(--ink-3);
}

.topbar-user .t-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--black);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 0.75rem;
  font-family: var(--font-display);
  overflow: hidden;
  flex-shrink: 0;
}

.topbar-user .t-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.topbar-user strong { color: var(--black); font-weight: 600; }

.btn-logout {
  padding: 0.45rem 1.125rem;
  background: transparent;
  border: 1px solid var(--rule-dark);
  color: var(--ink-2);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-body);
}

.btn-logout:hover { border-color: var(--black); color: var(--black); }

.topbar-brand { text-decoration: none; }

/* ── Profile body ───────────────────────────────────────────────────────── */
.profile-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding: 0 1.5rem;
  align-items: start;
}

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.profile-sidebar {
  padding: 3rem 1.5rem 2rem 0;
  border-right: 1px solid var(--rule);
  text-align: left;
  position: sticky;
  top: 96px;
}

.p-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--black);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 1.125rem;
  overflow: hidden;
}

.p-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.p-name {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 0.2rem;
}

.p-label {
  font-size: 0.8125rem;
  color: var(--ink-4);
  margin-bottom: 1.75rem;
}

.sidebar-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-cell { border-top: 1px solid var(--rule); padding-top: 0.75rem; }

.stat-cell .s-value {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--black);
  display: block;
}

.stat-cell .s-key { font-size: 0.75rem; color: var(--ink-4); }

.sidebar-note {
  font-size: 0.8rem;
  color: var(--ink-4);
  line-height: 1.65;
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
}

/* ── Main form area ─────────────────────────────────────────────────────── */
.profile-main {
  padding: 3rem 0 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-card { padding: 0; }

.section-card-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.section-card-header h2 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--black);
}

.section-card-header p { font-size: 0.8125rem; color: var(--ink-4); margin-top: 0.25rem; }

.section-heading-wrap { display: flex; align-items: center; gap: 0.625rem; }

.accent-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--black);
  flex-shrink: 0;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.375rem;
}

.profile-grid .span-2 { grid-column: 1 / -1; }
.profile-grid .field-group { margin-bottom: 0; }

textarea.field-input { resize: vertical; min-height: 96px; font-family: var(--font-body); }

/* ── Save button ─────────────────────────────────────────────────────────── */
.btn-save {
  padding: 0.75rem 2rem;
  background: var(--black);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-save:hover { background: var(--ink); }
.btn-save:disabled { opacity: 0.5; cursor: not-allowed; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  margin-top: 1.5rem;
}

.save-status-text { font-size: 0.85rem; color: var(--ink-4); }

/* ── Loading state ──────────────────────────────────────────────────────── */
.loading-card { padding: 4rem 0; text-align: center; }

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--rule);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 1rem;
}

.loading-card p { font-size: 0.9rem; color: var(--ink-4); }

/* ── Avatar upload widget ───────────────────────────────────────────────── */
.avatar-optional {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--ink-4);
  margin-left: 0.375rem;
}

.avatar-upload-wrap { display: flex; align-items: center; gap: 1.125rem; }

.avatar-preview {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--black);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
}

.avatar-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.avatar-upload-right { display: flex; flex-direction: column; gap: 0.4rem; }

.btn-upload-photo {
  display: inline-block;
  padding: 0.45rem 1rem;
  background: var(--surface);
  border: 1px solid var(--rule-dark);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  width: fit-content;
}

.btn-upload-photo:hover { border-color: var(--black); color: var(--black); }

.avatar-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.avatar-hint { font-size: 0.76rem; color: var(--ink-4); margin: 0; }

.btn-remove-photo {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.76rem;
  color: var(--red);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  text-align: left;
  width: fit-content;
}

.btn-remove-photo:hover { text-decoration: underline; }

/* ── Utility ────────────────────────────────────────────────────────────── */
.hidden-section { display: none; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .home-hero { grid-template-columns: 1fr; gap: 2.5rem; padding: 3rem 1.5rem; }
  .home-flow { border-left: none; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 2rem; }

  .profile-body { grid-template-columns: 1fr; gap: 0; }
  .profile-sidebar { border-right: none; border-bottom: 1px solid var(--rule); padding: 2rem 0; position: static; }
  .profile-main { padding-left: 0; padding-top: 2rem; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-grid .span-2 { grid-column: 1; }
}

@media (max-width: 576px) {
  .home-nav, .auth-topbar { padding: 1.25rem 1.25rem; }
  .auth-topbar .auth-steps { display: none; }
  .home-footer { flex-direction: column; gap: 0.5rem; padding: 1.25rem 1.25rem; }
  .profile-topbar { padding: 0 1.25rem; }
  .profile-body { padding: 0 1.25rem; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .btn-save { justify-content: center; }
}
