/* ── Variables ─────────────────────────────────────────────────── */
:root {
  --color-primary:       #1e3a5f;
  --color-accent:        #0891b2;
  --color-accent-hover:  #0e7490;
  --color-success:       #059669;
  --color-error:         #dc2626;
  --color-bg:            #f1f5f9;
  --color-surface:       #ffffff;
  --color-border:        #e2e8f0;
  --color-text:          #0f172a;
  --color-muted:         #64748b;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 8px rgba(0,0,0,.07), 0 1px 3px rgba(0,0,0,.05);
  --shadow-lg:  0 12px 24px rgba(0,0,0,.1), 0 4px 8px rgba(0,0,0,.06);
  --radius:     8px;
  --radius-lg:  12px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); color: var(--color-text); line-height: 1.55; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: var(--font); }

/* ── Login page ─────────────────────────────────────────────────── */
.login-layout {
  min-height: 100vh;
  background: linear-gradient(145deg, var(--color-primary) 0%, #2d5a8e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2.75rem 2.25rem;
  width: 100%;
  max-width: 390px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.login-brand-logo {
  width: 86px;
  height: 86px;
  object-fit: contain;
}
.logo-name {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
}
.logo-subtitle {
  color: var(--color-muted);
  font-size: 0.875rem;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn-google:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  box-shadow: var(--shadow-sm);
}

/* ── Alerts ─────────────────────────────────────────────────────── */
.alert {
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  text-align: left;
  margin-bottom: 1.25rem;
}
.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ── App layout ─────────────────────────────────────────────────── */
.app-layout {
  background: var(--color-bg);
  min-height: 100vh;
}

/* ── Navbar ─────────────────────────────────────────────────────── */
.navbar {
  background: var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,.08);
}
.nav-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
.nav-brand-logo {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  object-fit: contain;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.25);
  object-fit: cover;
}
.nav-name {
  color: rgba(255,255,255,.85);
  font-size: 0.875rem;
}
.nav-logout {
  color: rgba(255,255,255,.65);
  font-size: 0.8rem;
  padding: .25rem .6rem;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 5px;
  transition: color .15s, border-color .15s;
}
.nav-logout:hover { color: #fff; border-color: rgba(255,255,255,.5); }

/* ── Main content ───────────────────────────────────────────────── */
.main-content {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── Page header ────────────────────────────────────────────────── */
.page-header { margin-bottom: 1.75rem; }
.page-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}
.page-subtitle {
  color: var(--color-muted);
  margin-top: 0.3rem;
  font-size: 0.925rem;
}

/* ── Breadcrumb ─────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 1.25rem;
}
.breadcrumb a { color: var(--color-accent); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: #cbd5e1; }

/* ── Project cards ──────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
}

.project-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}
.project-card:not(.card-soon):hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card-soon { opacity: .65; }

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  margin-bottom: 1rem;
  flex-shrink: 0;
}
.card-icon--green  { background: #dcfce7; }
.card-icon--blue   { background: #dbeafe; }
.card-icon--orange { background: #ffedd5; }
.card-icon--purple { background: #ede9fe; }
.card-icon--red    { background: #fee2e2; }
.card-icon--gray   { background: #f1f5f9; }

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.4rem;
}
.card-desc {
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.55;
  flex: 1;
  margin-bottom: 1.25rem;
}
.card-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ── Badges ─────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge--active { background: #dcfce7; color: #166534; }
.badge--soon   { background: #f1f5f9; color: var(--color-muted); }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: .5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background .15s, box-shadow .15s, transform .1s;
  line-height: 1;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}
.btn-primary:not(:disabled):hover {
  background: var(--color-accent-hover);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-secondary:not(:disabled):hover { background: #e2e8f0; }

.btn-ghost {
  background: transparent;
  color: var(--color-muted);
  border: 1px solid var(--color-border);
}

.btn-lg { padding: .65rem 1.4rem; font-size: 0.95rem; }

/* ── Form elements ───────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.4rem;
}
.form-hint {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 0.3rem;
}
.form-input {
  width: 100%;
  max-width: 400px;
  padding: .55rem .75rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(8,145,178,.12);
}

/* ── Section card ────────────────────────────────────────────────── */
.section-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  margin-bottom: 1.1rem;
}
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-muted);
  margin-bottom: 1rem;
}

/* ── Drop zone ───────────────────────────────────────────────────── */
.dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: #f8fafc;
  transition: border-color .15s, background .15s;
  user-select: none;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--color-accent);
  background: #f0f9ff;
}
.dropzone-icon { font-size: 2rem; margin-bottom: 0.6rem; }
.dropzone-title { font-size: 0.95rem; font-weight: 500; margin-bottom: 0.2rem; }
.dropzone-hint { font-size: 0.8rem; color: var(--color-muted); }
.dropzone-hint em {
  color: var(--color-accent);
  text-decoration: underline;
  cursor: pointer;
  font-style: normal;
}

/* ── File list ───────────────────────────────────────────────────── */
.file-list {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.875rem;
}
.file-item-icon { color: #ef4444; font-size: 1rem; flex-shrink: 0; }
.file-item-name {
  flex: 1;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-item-size { color: var(--color-muted); font-size: 0.8rem; flex-shrink: 0; }
.file-item-rm {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: .15rem .3rem;
  border-radius: 4px;
  font-size: 0.85rem;
  line-height: 1;
  flex-shrink: 0;
  transition: color .15s;
}
.file-item-rm:hover { color: #ef4444; }

/* ── Process row ─────────────────────────────────────────────────── */
.process-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.file-count {
  font-size: 0.875rem;
  color: var(--color-muted);
}

/* ── Status cards ────────────────────────────────────────────────── */
.status-area { margin-top: 1.1rem; }

.status-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}
.status-card--loading { border-color: #bae6fd; background: #f0f9ff; }
.status-card--success { border-color: #bbf7d0; background: #f0fdf4; }
.status-card--error   { border-color: #fecaca; background: #fef2f2; }

.status-body { flex: 1; }
.status-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}
.status-card--loading .status-title { color: var(--color-accent); }
.status-card--success .status-title { color: var(--color-success); }
.status-card--error   .status-title { color: var(--color-error);   }

.status-desc { font-size: 0.875rem; color: var(--color-muted); }
.status-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: .05rem; }

.timer {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 0.3rem;
  font-variant-numeric: tabular-nums;
}

/* ── Spinner ─────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid #bae6fd;
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin .75s linear infinite;
  flex-shrink: 0;
  margin-top: .15rem;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .nav-name { display: none; }
  .main-content { padding: 1.25rem 1rem; }
  .projects-grid { grid-template-columns: 1fr; }
  .process-row { flex-direction: column; align-items: stretch; }
  .btn-lg { width: 100%; }
}
