:root {
  --main: #A50032;
  --main-light: #fff2f6;
  --bg: #f4f6f8;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d1d5db;
  --danger: #b00020;
  --success: #116b2e;
  --blue: #1d4ed8;
  --warning: #92400e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 24px;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 820px;
  margin: 0 auto;
}

.brand {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr);
  align-items: start;
  gap: 12px;
  background: white;
  padding: 22px;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0,0,0,.08);
  margin-bottom: 16px;
}

.brand-main {
  text-align: center;
}

.brand-spacer {
  min-height: 1px;
}

.site-logo {
  color: var(--main);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.15;
  text-decoration: none;
}

h1 {
  margin: 0 0 6px;
  color: var(--main);
  font-size: 30px;
}

h2 {
  margin: 0 0 12px;
  color: var(--main);
  font-size: 22px;
}

p {
  line-height: 1.55;
}

.header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.card {
  background: white;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0,0,0,.08);
  margin-bottom: 16px;
}

.class-box {
  background: var(--main-light);
  border: 1px solid rgba(165,0,50,.2);
  border-left: 5px solid var(--main);
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  line-height: 1.55;
}

.note {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  padding: 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 14px 0;
}

label {
  display: block;
  font-weight: bold;
  margin-top: 16px;
  margin-bottom: 6px;
}

input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 16px;
}

input:focus {
  outline: none;
  border-color: var(--main);
  box-shadow: 0 0 0 3px rgba(165,0,50,.12);
}

.btn {
  border: none;
  border-radius: 10px;
  font-weight: bold;
  padding: 12px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: var(--main);
  color: white;
}

.google-login-btn {
  align-items: center;
  display: inline-flex;
  gap: 10px;
  justify-content: center;
}

.google-icon {
  background: #ffffff;
  border-radius: 50%;
  flex: 0 0 auto;
  height: 22px;
  padding: 3px;
  width: 22px;
}

.btn-light {
  background: #f3f4f6;
  color: #111827;
  border: 1px solid #d1d5db;
}

.btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.full {
  width: 100%;
  margin-top: 16px;
}

.hidden {
  display: none !important;
}

.error {
  display: none;
  color: var(--danger);
  font-size: 13px;
  margin-top: 5px;
}

.message {
  margin-bottom: 16px;
  padding: 13px;
  border-radius: 10px;
  white-space: pre-line;
  line-height: 1.5;
}

.message.success {
  background: #e7f6ec;
  color: var(--success);
  border: 1px solid #b7e2c2;
}

.message.fail {
  background: #fdecea;
  color: var(--danger);
  border: 1px solid #f5c2c7;
}

.email-pill {
  display: inline-block;
  background: #eef2ff;
  color: #1d4ed8;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 5px 9px;
  font-weight: bold;
  margin-top: 6px;
  word-break: break-all;
}

.docs-list {
  margin-top: 14px;
}

.doc-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-top: 12px;
  background: #fafafa;
}

.doc-title {
  font-weight: bold;
  font-size: 17px;
}

.doc-meta {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 6px;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: bold;
  margin-top: 8px;
}

.badge-added,
.badge-created_azota {
  background: #eff6ff;
  color: var(--blue);
}

.badge-not_sent,
.badge-waiting_azota {
  background: #fff7ed;
  color: var(--warning);
}

.badge-active {
  background: #e7f6ec;
  color: var(--success);
}

.badge-failed,
.badge-deleted {
  background: #fdecea;
  color: var(--danger);
}

.open-sheet {
  display: inline-block;
  margin-top: 10px;
  background: var(--main);
  color: white;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 9px;
  font-weight: bold;
}

footer {
  text-align: center;
  color: var(--muted);
  padding: 18px 0;
  font-size: 14px;
}

footer a {
  color: var(--main);
  font-weight: bold;
  text-decoration: none;
}

@media (max-width: 640px) {
  body { padding: 12px; }
  .brand {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .brand-spacer { display: none; }
  .header-actions { justify-content: center; }
  .card { padding: 18px; }
}
