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

:root {
  --red:        #C8102E;
  --red-dark:   #A00C24;
  --red-deep:   #6B0016;
  --red-light:  #FFF0F2;
  --red-mid:    #FFBFCA;
  --black:      #111111;
  --black-2:    #1C1C1E;
  --gray-dark:  #3A3A3C;
  --gray-mid:   #6C6C70;
  --gray-light: #AEAEB2;
  --border:     #E5E5EA;
  --border-2:   #D1D1D6;
  --surface:    #F5F5F7;
  --white:      #FFFFFF;
  --green:      #1D7A4A;
  --green-bg:   #ECFDF5;
  --radius:     10px;
  --radius-sm:  7px;
  --shadow:     0 1px 4px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 6px 24px rgba(0,0,0,.10);
  --tr:         170ms ease;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--black);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}
.container { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* ─── Header ─────────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--white);
  border-bottom: 2px solid var(--red);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 8px rgba(200,16,46,.10);
}
.site-header .container { display: flex; align-items: center; padding: 8px 20px; }
.logo { display: flex; align-items: center; text-decoration: none; cursor: pointer; }
.logo-img { width: auto; height: auto; display: block; }
.logo-text { font-size: 20px; font-weight: 800; letter-spacing: .06em; color: var(--red); }

/* ─── Hero ───────────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%);
  color: var(--white);
  padding: 60px 0 52px;
  position: relative;
  overflow: hidden;
}
.hero-bg-pattern {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.07) 0%, transparent 50%),
    radial-gradient(circle at 10% 80%, rgba(0,0,0,.15) 0%, transparent 40%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: rgba(255,255,255,.95);
  font-size: 12px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  padding: 5px 14px; border-radius: 20px; margin-bottom: 18px;
}
.hero-title { font-size: clamp(28px,5vw,44px); font-weight: 800; line-height: 1.15; margin-bottom: 14px; }
.hero-sub   { font-size: 16px; opacity: .85; max-width: 440px; }

/* ─── Vacancy ────────────────────────────────────────────────────────────────── */
.vacancy-section { padding: 32px 0 0; }
.vacancy-card {
  background: var(--white);
  border: 2px solid var(--red);
  border-radius: var(--radius);
  padding: 28px 32px;
}
.vacancy-label {
  font-size: 11px; font-weight: 700;
  letter-spacing: .10em; text-transform: uppercase;
  color: var(--red); margin-bottom: 8px;
}
.vacancy-title { font-size: 22px; font-weight: 700; color: var(--black-2); margin-bottom: 20px; }
.vacancy-body  { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width:580px) { .vacancy-body { grid-template-columns: 1fr; } }
.vacancy-col h4 {
  font-size: 11px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--gray-mid); margin-bottom: 10px;
}
.vacancy-text { font-size: 14px; color: var(--gray-dark); line-height: 1.7; white-space: pre-line; }

/* ─── Form ───────────────────────────────────────────────────────────────────── */
.form-section { padding: 32px 0 64px; }
.form-wrapper {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 36px 40px;
}
@media (max-width:600px) { .form-wrapper { padding: 24px 18px; } }
.form-header { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.form-header h2 { font-size: 20px; font-weight: 700; color: var(--black-2); margin-bottom: 4px; }
.form-header p  { font-size: 13px; color: var(--gray-mid); }

/* Fields */
.field-group { margin-bottom: 20px; position: relative; }
.field-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width:540px) { .field-row { grid-template-columns: 1fr; } }

.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--black); margin-bottom: 6px; }
.required-mark { color: var(--red); }

.field-input, .field-textarea {
  width: 100%; border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 14px; font-family: inherit;
  color: var(--black); background: var(--white);
  transition: border-color var(--tr), box-shadow var(--tr);
  outline: none;
}
.field-input:focus, .field-textarea:focus {
  border-color: var(--red); box-shadow: 0 0 0 3px rgba(200,16,46,.10);
}
.field-input.error { border-color: var(--red); }
.field-textarea { resize: vertical; min-height: 100px; }
.field-error { display: block; font-size: 12px; color: var(--red); margin-top: 4px; min-height: 16px; }
.char-count  { display: block; font-size: 11px; color: var(--gray-light); text-align: right; margin-top: 4px; }

/* Phone */
.phone-wrap  { display: flex; align-items: center; }
.phone-prefix {
  background: var(--surface); border: 1.5px solid var(--border-2);
  border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  padding: 10px 12px; font-size: 14px; font-weight: 600; color: var(--gray-dark); white-space: nowrap;
}
.phone-input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; flex: 1; }

/* Date */
.date-wrap { position: relative; }
.date-input { padding-right: 44px; }
.date-btn {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--gray-light); cursor: pointer;
  padding: 4px; border-radius: 4px; transition: color var(--tr);
}
.date-btn:hover { color: var(--red); }

/* Calendar */
.calendar-picker {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 200;
  background: var(--white); border: 1.5px solid var(--border-2);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  width: 280px; padding: 12px; user-select: none;
}
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-nav {
  background: none; border: none; font-size: 20px;
  color: var(--gray-dark); cursor: pointer; padding: 2px 8px;
  border-radius: 4px; transition: background var(--tr);
}
.cal-nav:hover { background: var(--surface); }
.cal-title { display: flex; gap: 6px; }
.cal-select {
  border: 1px solid var(--border-2); border-radius: 4px;
  padding: 3px 6px; font-size: 13px; font-family: inherit;
  color: var(--black); background: var(--white); cursor: pointer;
}
.cal-days-header {
  display: grid; grid-template-columns: repeat(7,1fr);
  text-align: center; font-size: 11px; font-weight: 600;
  color: var(--gray-light); margin-bottom: 4px;
}
.cal-days { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.cal-day {
  text-align: center; padding: 5px 2px; font-size: 13px;
  border-radius: 4px; cursor: pointer; color: var(--black); transition: background var(--tr);
}
.cal-day:hover:not(.cal-empty):not(.cal-disabled) { background: var(--red-light); color: var(--red); }
.cal-day.cal-today    { font-weight: 700; color: var(--red); }
.cal-day.cal-selected { background: var(--red); color: var(--white) !important; }
.cal-day.cal-empty, .cal-day.cal-disabled { cursor: default; color: var(--gray-light); opacity: .5; }

/* Photo */
.photo-upload {
  border: 2px dashed var(--border-2); border-radius: var(--radius);
  overflow: hidden; transition: border-color var(--tr); cursor: pointer; position: relative;
}
.photo-upload:hover { border-color: var(--red); }
.photo-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.photo-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 28px 20px; color: var(--gray-light); text-align: center;
  font-size: 13px; pointer-events: none;
}
.photo-placeholder small { font-size: 11px; }
.photo-preview { width: 100%; max-height: 200px; object-fit: cover; display: block; }
.photo-remove {
  display: block; width: 100%; padding: 8px;
  background: rgba(200,16,46,.07); color: var(--red);
  border: none; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background var(--tr);
}
.photo-remove:hover { background: rgba(200,16,46,.14); }

/* Submit */
.submit-btn {
  width: 100%; padding: 14px 24px;
  background: var(--red); color: var(--white);
  border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 700; font-family: inherit;
  cursor: pointer; margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: background var(--tr), transform var(--tr);
  letter-spacing: .01em;
}
.submit-btn:hover   { background: var(--red-dark); }
.submit-btn:active  { transform: scale(.99); }
.submit-btn:disabled{ opacity: .65; cursor: not-allowed; }

.btn-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: white; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-outline {
  display: inline-block; margin-top: 12px; padding: 10px 22px;
  border: 1.5px solid var(--red); color: var(--red);
  background: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background var(--tr), color var(--tr); font-family: inherit;
}
.btn-outline:hover { background: var(--red); color: var(--white); }

/* Success / Error */
.success-message { text-align: center; padding: 48px 20px; }
.success-icon {
  width: 64px; height: 64px;
  background: var(--green-bg); color: var(--green);
  border-radius: 50%; font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 20px;
}
.success-message h3 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.success-message p  { color: var(--gray-dark); }
.error-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #FFF0F2; border: 1px solid var(--red-mid);
  border-radius: var(--radius-sm); padding: 12px 16px;
  font-size: 14px; color: var(--red); margin-top: 16px;
}
.error-banner button { background: none; border: none; color: var(--red); cursor: pointer; font-size: 16px; flex-shrink: 0; }

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer { background: var(--black-2); color: rgba(255,255,255,.75); padding: 40px 0 0; }
.footer-top {
  display: grid; grid-template-columns: 220px 1fr; gap: 40px;
  padding-bottom: 36px; border-bottom: 1px solid rgba(255,255,255,.1);
}
@media (max-width:640px) { .footer-top { grid-template-columns: 1fr; } }

.footer-brand .footer-logo-text { font-size: 18px; font-weight: 800; letter-spacing: .06em; color: rgba(255,255,255,.95); }
.footer-brand .footer-logo-img  { max-width: 220px; width: auto; height: auto; object-fit: contain; display: block; }
.footer-brand p { font-size: 13px; color: rgba(255,255,255,.45); margin-top: 8px; }

.footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width:480px) { .footer-links { grid-template-columns: 1fr; } }

.footer-col h5 {
  font-size: 11px; font-weight: 700; letter-spacing: .10em; text-transform: uppercase;
  color: rgba(255,255,255,.35); margin-bottom: 14px;
}
.footer-col a {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  color: rgba(255,255,255,.75); text-decoration: none;
  font-size: 13px; font-weight: 500; margin-bottom: 14px;
  transition: color var(--tr);
}
.footer-col a:hover { color: var(--white); }
.footer-col a.active-link { color: #FF7B8A; }
.link-icon    { width: 14px; height: 14px; opacity: .55; flex-shrink: 0; }
.link-desc    { display: block; width: 100%; font-size: 11px; font-weight: 400; color: rgba(255,255,255,.35); margin-top: -6px; padding-left: 21px; }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; font-size: 12px; color: rgba(255,255,255,.3);
}

/* ─────────────────────────────────────────────────────────────────────────────
   ADMIN PANEL
   ─────────────────────────────────────────────────────────────────────────── */
.admin-body { background: var(--surface); min-height: 100vh; }

/* Login */
.admin-login-wrap {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 24px;
  background: linear-gradient(135deg, var(--red-deep) 0%, var(--red) 100%);
}
.admin-login-card {
  background: var(--white); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  padding: 44px 40px; width: 100%; max-width: 380px; text-align: center;
}
@media (max-width:440px) { .admin-login-card { padding: 32px 24px; } }

.admin-login-logo { margin-bottom: 24px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.admin-login-logo img  { max-height: 48px; max-width: 180px; object-fit: contain; }
.logo-text-login { font-size: 22px; font-weight: 800; letter-spacing: .06em; color: var(--red); }
.admin-login-card h2  { font-size: 20px; font-weight: 700; margin-bottom: 4px; color: var(--black-2); }
.admin-login-card > p { font-size: 13px; color: var(--gray-mid); margin-bottom: 28px; }

/* Nav */
.admin-nav {
  background: var(--white); border-bottom: 2px solid var(--red);
  display: flex; align-items: center;
  height: 54px; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 8px rgba(200,16,46,.08);
}
.admin-nav-brand {
  padding: 0 22px; font-weight: 800; font-size: 15px;
  color: var(--red); border-right: 1px solid var(--border);
  height: 100%; display: flex; align-items: center; white-space: nowrap;
  letter-spacing: .04em;
}
.admin-nav-tabs { display: flex; flex: 1; overflow-x: auto; }
.admin-tab {
  padding: 0 18px; height: 54px;
  display: flex; align-items: center;
  font-size: 13px; font-weight: 500; color: var(--gray-dark);
  cursor: pointer; border: none; background: none;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: color var(--tr), border-color var(--tr);
  font-family: inherit; white-space: nowrap;
}
.admin-tab:hover  { color: var(--red); }
.admin-tab.active { color: var(--red); border-bottom-color: var(--red); font-weight: 600; }
.admin-nav-right  { margin-left: auto; padding: 0 16px; }

/* Content */
.admin-content { max-width: 720px; margin: 0 auto; padding: 28px 20px 80px; }
.admin-section  { display: none; }
.admin-section.active { display: block; }
.admin-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px 28px; margin-bottom: 18px;
}
@media (max-width:600px) { .admin-card { padding: 18px 16px; } }
.admin-card h3 {
  font-size: 14px; font-weight: 700; color: var(--black-2);
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}

/* Info box */
.info-box {
  background: #FFF8F0; border: 1px solid #FFD9A0;
  border-radius: var(--radius-sm); padding: 12px 16px;
  font-size: 13px; color: #7A4400; margin-bottom: 18px; line-height: 1.65;
}
.info-box code { background: rgba(0,0,0,.07); padding: 1px 5px; border-radius: 3px; font-size: 12px; }

/* Toggle */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.toggle-row:first-of-type { padding-top: 0; }
.toggle-info h4 { font-size: 14px; font-weight: 600; color: var(--black-2); }
.toggle-info p  { font-size: 12px; color: var(--gray-mid); margin-top: 2px; }

.toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--border-2);
  border-radius: 24px; cursor: pointer; transition: background var(--tr);
}
.toggle-slider::before {
  content: ''; position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px; background: white; border-radius: 50%;
  transition: transform var(--tr); box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--red); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Buttons */
.save-btn {
  padding: 9px 22px; background: var(--red); color: white;
  border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: background var(--tr);
}
.save-btn:hover    { background: var(--red-dark); }
.save-btn:disabled { opacity: .6; cursor: not-allowed; }

.outline-btn {
  padding: 9px 20px;
  background: none; border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--gray-dark);
  cursor: pointer; font-family: inherit; transition: all var(--tr);
}
.outline-btn:hover { border-color: var(--red); color: var(--red); }

.danger-btn {
  padding: 9px 20px; background: none;
  border: 1.5px solid #FFBFCA; color: var(--red);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer;
  font-family: inherit; transition: all var(--tr);
}
.danger-btn:hover { background: var(--red-light); }

.test-btn {
  padding: 9px 20px; background: #F0FFF4;
  border: 1.5px solid #86EFAC; color: #166534;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all var(--tr);
}
.test-btn:hover    { background: #DCFCE7; }
.test-btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; align-items: center; }

.logout-btn {
  padding: 7px 16px; background: none;
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--gray-dark);
  cursor: pointer; font-family: inherit; transition: all var(--tr);
}
.logout-btn:hover { border-color: var(--red); color: var(--red); }

/* Logo upload area */
.logo-preview-wrap {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 16px; background: var(--surface);
  border-radius: var(--radius-sm); margin-bottom: 18px;
}
.logo-preview-placeholder {
  width: 100px; height: 60px;
  background: var(--border); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--gray-mid);
}
#adminLogoPreview {
  max-height: 60px; max-width: 160px;
  object-fit: contain; border-radius: var(--radius-sm);
}
.logo-preview-info { flex: 1; }
.logo-preview-info .logo-preview-label { font-size: 12px; font-weight: 600; color: var(--black-2); margin-bottom: 4px; }
.logo-preview-info .logo-preview-text  { font-size: 12px; color: var(--gray-mid); }

/* Field status message */
.field-msg { font-size: 12px; margin-top: 6px; min-height: 16px; }

/* Toast */
.admin-toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--black-2); color: white;
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; z-index: 9999;
  transform: translateY(20px); opacity: 0;
  transition: all .3s ease; pointer-events: none;
  max-width: 320px;
}
.admin-toast.show     { transform: translateY(0); opacity: 1; }
.admin-toast.success  { background: var(--green); }
.admin-toast.error    { background: var(--red); }

/* Utils */
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }

/* ─── Links Manager ──────────────────────────────────────────────────────────── */
.link-row {
  display: grid;
  grid-template-columns: 28px 1fr 1fr 90px 70px 80px;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.link-row:last-child { border-bottom: none; }
.link-row-header {
  font-size: 11px; font-weight: 700; color: var(--gray-mid);
  letter-spacing: .06em; text-transform: uppercase;
  padding-bottom: 8px; border-bottom: 2px solid var(--border);
  display: grid;
  grid-template-columns: 28px 1fr 1fr 90px 70px 80px;
  gap: 8px;
}
.link-drag {
  cursor: grab; color: var(--gray-light); font-size: 18px;
  text-align: center; line-height: 1;
  padding: 4px 0;
}
.link-drag:active { cursor: grabbing; }
.link-row.dragging { opacity: .4; background: var(--red-light); border-radius: 6px; }
.link-row.drag-over { border-top: 2px solid var(--red); }
.link-input {
  border: 1px solid var(--border-2); border-radius: 5px;
  padding: 6px 9px; font-size: 12px; font-family: inherit;
  color: var(--black); width: 100%; outline: none;
  transition: border-color var(--tr);
}
.link-input:focus { border-color: var(--red); }
.link-col-select {
  border: 1px solid var(--border-2); border-radius: 5px;
  padding: 6px 6px; font-size: 12px; font-family: inherit;
  color: var(--black); width: 100%; outline: none; background: white;
}
.link-current-check {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--gray-dark);
}
.link-current-check input { accent-color: var(--red); width: 14px; height: 14px; }
.link-delete-btn {
  background: none; border: 1px solid #FFBFCA; color: var(--red);
  border-radius: 5px; padding: 5px 10px; font-size: 12px;
  cursor: pointer; transition: all var(--tr); font-family: inherit;
  white-space: nowrap;
}
.link-delete-btn:hover { background: var(--red-light); }
@media (max-width: 640px) {
  .link-row, .link-row-header {
    grid-template-columns: 28px 1fr 70px;
    grid-template-rows: auto auto auto;
  }
}
