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

:root {
  --bg: #F6F3EC;
  --card-bg: #FFFDF8;
  --ink: #14161F;
  --ink-soft: #5B5C63;
  --input-bg: #E8F0FE;
  --accent: #14161F;
  --accent-text: #F6F3EC;
  --danger: #B3261E;
  --danger-bg: #FBEAE9;
  --ok: #2E7D32;
  --border: rgba(20, 22, 31, 0.08);
  --shadow: rgba(20, 22, 31, 0.06) 0px 2px 24px 0px;
  --radius-card: 22px;
  --radius-input: 10px;
  --radius-btn: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Roboto Flex", sans-serif;
  min-height: 100vh;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.center-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 36px;
  width: 100%;
  max-width: 400px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand img { width: 36px; height: 36px; border-radius: 10px; }
.brand span { font-weight: 700; font-size: 18px; letter-spacing: 0.02em; }

h1 { font-size: 26px; font-weight: 700; margin: 0 0 6px; }
.subtitle { color: var(--ink-soft); font-size: 14px; margin: 0 0 24px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

input[type=text], input[type=tel], input[type=file], select, textarea {
  width: 100%;
  background: var(--input-bg);
  border: none;
  border-radius: var(--radius-input);
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  margin-bottom: 16px;
}

input[type=file] { background: transparent; border: 1.5px dashed var(--border); padding: 16px 14px; }

textarea { resize: vertical; min-height: 70px; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
}

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: var(--radius-btn);
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
}
.btn-primary:disabled { opacity: 0.5; cursor: default; }

.btn-secondary {
  width: 100%;
  background: var(--input-bg);
  color: var(--ink);
  border-radius: var(--radius-btn);
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  margin-top: 10px;
}

.btn-vk {
  width: 100%;
  background: #0077FF;
  color: #fff;
  border-radius: var(--radius-btn);
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 13px;
  margin: 16px 0;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.hint { font-size: 12px; color: var(--ink-soft); margin-top: -10px; margin-bottom: 16px; }
.error { color: var(--danger); background: var(--danger-bg); border-radius: var(--radius-input); padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }

.link-btn {
  background: none;
  color: var(--ink-soft);
  text-decoration: underline;
  font-size: 13px;
  padding: 0;
}

/* ---- Приложение после входа ---- */
header.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

nav.tabs {
  display: flex;
  gap: 4px;
  background: var(--input-bg);
  border-radius: var(--radius-btn);
  padding: 4px;
}
nav.tabs button {
  background: transparent;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}
nav.tabs button.active { background: var(--accent); color: var(--accent-text); }

main.app-main {
  flex: 1;
  padding: 20px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}

.section-title { font-size: 20px; font-weight: 700; margin: 0 0 16px; }

.recipe-result {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 24px;
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.5;
  margin-top: 16px;
}

.history-item {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 12px;
  cursor: pointer;
}
.history-item .meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-soft); margin-bottom: 4px; }
.history-item .brand { font-weight: 600; font-size: 15px; }
.history-item .full-text { white-space: pre-wrap; margin-top: 10px; font-size: 14px; line-height: 1.5; display: none; }
.history-item.open .full-text { display: block; }

.profile-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.profile-row:last-child { border-bottom: none; }
.profile-row .k { color: var(--ink-soft); font-size: 14px; }
.profile-row .v { font-weight: 600; font-size: 14px; }

.spinner-text { color: var(--ink-soft); font-size: 14px; text-align: center; padding: 20px 0; }

.icon-btn { background: transparent; color: var(--ink-soft); font-size: 13px; text-decoration: underline; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161F;
    --card-bg: #1D2029;
    --ink: #F6F3EC;
    --ink-soft: #9A9BA5;
    --input-bg: #262A36;
    --accent: #F6F3EC;
    --accent-text: #14161F;
    --border: rgba(246, 243, 236, 0.08);
    --shadow: rgba(0, 0, 0, 0.35) 0px 2px 24px 0px;
    --danger-bg: rgba(179, 38, 30, 0.15);
  }
}
