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

:root {
  --terracotta: #D9713C;
  --terracotta-dark: #B85A2C;
  --cream: #FFFCF9;
  --cream-2: #F6EDE1;
  --border: #E8DCCB;
  --charcoal: #241C15;
  --text-muted: #7A6F62;
  --green: #5B7A63;
  --red: #B3453A;
  --shadow-sm: 0 1px 2px rgba(36, 28, 21, 0.06), 0 1px 1px rgba(36, 28, 21, 0.04);
  --shadow-md: 0 4px 16px rgba(36, 28, 21, 0.08), 0 1px 2px rgba(36, 28, 21, 0.04);
  --radius: 12px;
  font-family: 'Inter', -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream-2);
  color: var(--charcoal);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--terracotta-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(255, 252, 249, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--charcoal);
}
.brand img { height: 34px; border-radius: 9px; }

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 9px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--terracotta); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--terracotta-dark); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--charcoal); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--cream-2); border-color: var(--terracotta); }
.btn-block { width: 100%; }

.auth-wrap {
  min-height: calc(100vh - 74px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
}

.card h1 { font-size: 21px; margin: 0 0 6px; letter-spacing: -0.01em; }
.card .sub { color: var(--text-muted); font-size: 14px; margin: 0 0 24px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--charcoal);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(217, 113, 60, 0.15);
}

.error-box {
  background: #FBEAE7;
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

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

.dash-wrap { padding: 32px; max-width: 960px; margin: 0 auto; }
.dash-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.dash-header h1 { font-size: 21px; margin: 0; letter-spacing: -0.01em; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.project-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.project-card h3 { margin: 0 0 6px; font-size: 15px; }
.project-card .status {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--cream-2);
  color: var(--terracotta-dark);
  margin-top: 8px;
}
.empty-state { color: var(--text-muted); text-align: center; padding: 60px 20px; font-size: 14px; }

.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(36, 28, 21, 0.45);
  backdrop-filter: blur(2px);
  align-items: center; justify-content: center;
  z-index: 50;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--cream); border-radius: 16px; padding: 28px; width: 100%;
  max-width: 380px; position: relative; box-shadow: var(--shadow-md);
}

.auth-modal { max-width: 420px; padding: 32px; }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; font-size: 22px; line-height: 1;
  color: var(--text-muted); cursor: pointer; padding: 4px;
}
.auth-tabs { display: flex; gap: 4px; margin-bottom: 22px; background: var(--cream-2); border-radius: 10px; padding: 4px; }
.auth-tab {
  flex: 1; padding: 9px; border: none; background: none; border-radius: 7px;
  font-size: 14px; font-weight: 600; color: var(--text-muted); cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.auth-tab.active { background: var(--cream); color: var(--charcoal); box-shadow: var(--shadow-sm); }

.checkbox-field label { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; font-weight: 400; color: var(--text-muted); }
.checkbox-field input { width: auto; margin-top: 2px; }

.lang-switch { display: flex; gap: 4px; }
.lang-switch button {
  background: none; border: 1px solid var(--border); border-radius: 7px;
  padding: 5px 10px; font-size: 12px; font-weight: 600; color: var(--text-muted); cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.lang-switch button.active { background: var(--terracotta); color: #fff; border-color: var(--terracotta); }

.nav-auth-btn { display: inline-flex; align-items: center; gap: 8px; }

@media (max-width: 720px) {
  .lang-switch button.active { display: none; }
  .nav-auth-text { display: none; }
  .nav-auth-btn { padding: 10px; }
}
