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

:root {
  --ink:          #1a1612;
  --ink-soft:     #4a4038;
  --paper:        #f5f0e8;
  --cream:        #ede6d6;
  --rule:         #d4c9b0;
  --accent:       #c0392b;
  --accent-light: #e8b4af;
  --white:        #fdfaf4;
  --radius:       4px;
  --ff-display:   'Playfair Display', Georgia, serif;
  --ff-body:      'DM Sans', sans-serif;
}

html, body { height: 100%; }

body {
  font-family: var(--ff-body);
  background-color: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      rgba(180,160,120,0.12) 28px
    );
}

/* ── TOPBAR ── */
.topbar {
  background: var(--ink);
  color: var(--paper);
  padding: 0 32px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(26,22,18,0.35);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--paper);
  font-family: var(--ff-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: var(--accent);
  color: #fff;
  font-family: var(--ff-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  display: grid;
  place-items: center;
  border-radius: 3px;
  flex-shrink: 0;
}

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

.user-actions span {
  font-size: 13px;
  font-weight: 400;
  color: var(--rule);
  letter-spacing: 0.04em;
}

.divider { color: var(--ink-soft) !important; }

.logout-btn {
  background: none;
  border: 1px solid rgba(213,200,180,0.35);
  color: var(--rule);
  font-family: var(--ff-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

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

/* ── NAVBAR ── */
.navbar {
  background: var(--cream);
  border-bottom: 1px solid var(--rule);
  padding: 0 32px;
  height: 48px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.nav-back {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.nav-back:hover { color: var(--accent); }

.nav-title {
  font-family: var(--ff-display);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.01em;
  text-align: center;
  white-space: nowrap;
}

/* ── MAIN ── */
.main {
  flex: 1;
  padding: 36px 32px 60px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── OUTER CONTAINER (large bordered box from wireframe) ── */
.outer-container {
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--cream);
  padding: 24px;
  min-height: 380px;
  box-shadow:
    0 1px 3px rgba(26,22,18,0.04),
    0 4px 16px rgba(26,22,18,0.05);
}

/* ── INNER FORM CARD (nested box from wireframe) ── */
.form-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 36px 40px 32px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 1px 3px rgba(26,22,18,0.05),
    0 4px 18px rgba(26,22,18,0.05);
}

/* Corner fold detail */
.form-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 36px 36px 0;
  border-color: transparent var(--cream) transparent transparent;
}

/* ── FORM ROW ── */
.form-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: right;
  padding-right: 4px;
}

/* ── INPUT ── */
input[type="text"] {
  width: 100%;
  font-family: var(--ff-body);
  font-size: 14.5px;
  font-weight: 300;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 9px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input[type="text"]::placeholder {
  color: #b8a98c;
  font-weight: 300;
}

input[type="text"]:focus {
  border-color: var(--ink);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(26,22,18,0.07);
}

/* ── ACTIONS ── */
/* Wireframe: Save button centered under the input */
.form-actions {
  display: flex;
  justify-content: center;
  padding-left: 94px; /* align roughly under input (label col width + gap) */
}

.save-btn {
  font-family: var(--ff-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--ink);
  border: none;
  border-radius: var(--radius);
  padding: 10px 40px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s;
}

.save-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateX(-101%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.save-btn span { position: relative; z-index: 1; }

.save-btn:hover::after { transform: translateX(0); }
.save-btn:hover { transform: translateY(-1px); }
.save-btn:active { transform: translateY(0); }

/* ── FOOTER ── */
.footer {
  background: var(--cream);
  border-top: 1px solid var(--rule);
  text-align: center;
  padding: 16px 20px;
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: #8a7d68;
}

/* ── RESPONSIVE ── */
@media (max-width: 540px) {
  .main { padding: 24px 16px 48px; }
  .topbar, .navbar { padding: 0 16px; }
  .form-card { padding: 24px 20px; }
  .form-row { grid-template-columns: 1fr; gap: 6px; }
  label { text-align: left; }
  .form-actions { padding-left: 0; justify-content: flex-end; }
}