/* ============================================
   ZALUZIEEE.CZ — Design System pro formulář
   ============================================ */

/* --- Google Font --- */
@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500;600;700&display=swap');

/* --- CSS Proměnné (brand barvy) --- */
:root {
  --color-primary:          #ff336a;
  --color-primary-dark:     #e0265a;
  --color-secondary:        #1e8767;
  --color-secondary-dark:   #166b51;
  --color-bg:               #ffffff;
  --color-bg-light:         #ffe5ed;
  --color-text:             #000000;
  --color-text-muted:       #606266;
  --color-border:           #dadbdd;
  --color-error:            #f56c6c;
  --font-main:              'Work Sans', sans-serif;
  --radius:                 10px;
  --radius-pill:            40px;
}

/* --- Reset / Base --- */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-text);
  background-color: #f5f6f8;
  margin: 0;
  padding: 48px 16px 80px;
  min-height: 100vh;
}

/* --- Page header --- */
.page-header {
  text-align: center;
  margin-bottom: 32px;
}

.page-header .site-logo {
  height: 48px;
  width: auto;
  display: block;
  margin: 0 auto 16px;
}

.page-header h1 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 6px;
}

.page-header p {
  color: var(--color-text-muted);
  font-size: 15px;
  margin: 0;
}

/* --- Nadpisy --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-main);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
  margin: 0 0 16px;
}

/* --- Formulář — wrapper --- */
.form-wrapper {
  background-color: var(--color-bg);
  border-radius: var(--radius);
  padding: 40px 48px;
  max-width: 680px;
  margin: 0 auto;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.form-section-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 28px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.form-section-title:first-of-type {
  margin-top: 0;
}

/* --- Form Group --- */
.form-group { margin-bottom: 20px; }

/* --- Label --- */
label, .form-label {
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  display: block;
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--color-primary);
  margin-left: 2px;
}

/* --- Inputy, textarea, select --- */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
textarea,
select {
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 400;
  color: var(--color-text-muted);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 11px 15px;
  width: 100%;
  display: block;
  line-height: 1;
  outline: none;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  -webkit-appearance: none;
  appearance: none;
}

input::placeholder, textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(30, 135, 103, 0.15);
  color: var(--color-text);
}

input.is-error, textarea.is-error, select.is-error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(245, 108, 108, 0.12);
}

textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.5;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23606266' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

/* --- Chybové hlášení --- */
.error-message, .form-error {
  font-size: 13px;
  color: var(--color-error);
  margin-top: 5px;
  display: block;
}

/* --- Nápověda pod polem --- */
.form-hint {
  font-size: 13px;
  color: var(--color-text-muted);
  opacity: 0.75;
  margin-top: 5px;
  display: block;
}

/* --- File upload --- */
.file-upload-area {
  position: relative;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.file-upload-area:focus-within {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(30, 135, 103, 0.15);
}

.file-upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}

.file-upload-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 15px;
  color: var(--color-text-muted);
  font-size: 15px;
  pointer-events: none;
  user-select: none;
}

.file-upload-trigger svg {
  flex-shrink: 0;
  color: var(--color-secondary);
}

.file-upload-area:focus-within .file-upload-trigger,
.file-upload-area:hover .file-upload-trigger {
  color: var(--color-text);
}

/* Vybrané soubory */
.file-list {
  list-style: none;
  margin: 0;
  padding: 0 12px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.file-list:empty {
  display: none;
}

.file-list li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  background: var(--color-bg-light);
  border: 1px solid rgba(255, 51, 106, 0.2);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-primary-dark);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list li svg {
  flex-shrink: 0;
}

/* --- Tlačítka --- */
.btn,
.btn-primary,
button[type="submit"] {
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  background-color: var(--color-primary);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 13px 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1.5;
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all 0.25s ease;
  -webkit-appearance: none;
  appearance: none;
}

.btn:hover,
.btn-primary:hover,
button[type="submit"]:hover {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 51, 106, 0.3);
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* --- 2-sloupcový layout --- */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* --- Footer actions --- */
.form-actions {
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* --- Toast notifikace --- */
.toast-container {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 500;
  padding: 14px 20px;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,0.13);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease;
  max-width: 360px;
}

.toast.toast-success {
  background-color: var(--color-secondary);
  color: #fff;
}

.toast.toast-error {
  background-color: var(--color-error);
  color: #fff;
}

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

/* --- Spinner --- */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .form-wrapper { padding: 24px 20px; }
  .page-header h1 { font-size: 22px; }
  .form-actions { flex-direction: column; align-items: stretch; }
  button[type="submit"] { justify-content: center; width: 100%; }
  .toast-container { left: 16px; right: 16px; bottom: 16px; }
}
