/* ============================================
   SHARED.CSS — общие стили staff-portal
   Пресет: taste-skill user-light (warm, minimal)
   ============================================ */

:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --text: #222222;
  --text-secondary: #888888;
  --text-muted: #aaaaaa;
  --border: #e5e5e5;
  --accent: #1a5a3a;
  --accent-light: #eef5f0;
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-hover: 0 2px 8px rgba(0,0,0,0.06);
  --max-width: 960px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}

/* ===== ПОРТАЛ ===== */
.auth-screen {
  max-width: 400px;
  margin: 0 auto;
  padding: 60px 20px 40px;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.auth-card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.auth-card .subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.auth-error {
  color: var(--error);
  font-size: 0.85rem;
  margin-bottom: 12px;
  display: none;
}

.auth-error.show {
  display: block;
}

.auth-footer {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
}

.auth-footer a {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

/* ===== ПОРТАЛ — ДАШБОРД ===== */
.app {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px;
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-meta h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.user-meta p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.logout-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.logout-btn:hover {
  background: #f5f2ee;
}

/* Сетка модулей */
.module-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.module-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s, border-color 0.15s;
}

.module-tile:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.module-tile:active {
  transform: scale(0.98);
}

.mt-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-weight: 600;
}

.mt-body {
  min-width: 0;
}

.mt-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.mt-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.empty-state {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
  padding: 40px 16px;
  grid-column: 1 / -1;
}

/* ===== STANDALONE СТРАНИЦЫ ===== */
.page-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px;
}

.module-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.module-header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  flex: 1;
}

.back-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.back-btn:hover {
  background: #f5f2ee;
}

.module-content {
  display: none;
}

/* ===== ЭКРАНЫ СОСТОЯНИЙ ===== */
.pending-screen {
  display: none;
  text-align: center;
  padding: 80px 20px;
}

.pending-screen.active {
  display: block;
}

.pending-icon {
  width: 80px;
  height: 80px;
  background: #fef9c3;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.pending-icon svg {
  width: 40px;
  height: 40px;
  color: #ca8a04;
}

.pending-screen h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.pending-screen p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 400px;
  margin: 0 auto;
}

/* ===== ФОРМЫ ===== */
.field-group {
  margin-bottom: 16px;
}

.field-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.field-group label .optional {
  font-weight: normal;
  color: var(--text-muted);
  text-transform: none;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
input[type="number"],
input[type="file"],
textarea,
select {
  width: 100%;
  padding: 14px 16px;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.15s;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
}

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

input[type="file"] {
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  padding: 8px 16px;
  margin-right: 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: #f0f0f0;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

input[type="file"]::file-selector-button:hover {
  background: #e5e5e5;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

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

/* ===== КНОПКИ ===== */
.actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  flex: 1;
  padding: 16px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #f5f2ee;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  padding: 14px 24px;
  background: var(--text);
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  z-index: 100;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  background: var(--success);
}

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

/* ===== КАРТОЧКИ ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

/* ===== НОВОСТИ ===== */
.news-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.news-item h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.news-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.news-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
}

.news-image {
  width: 100%;
  border-radius: var(--radius-sm);
  margin-top: 12px;
}

.news-likes {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.like-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-family: inherit;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.like-btn:hover {
  background: #f5f2ee;
}

.like-btn.liked {
  color: var(--error);
}

.like-btn svg {
  width: 18px;
  height: 18px;
}

.like-avatars {
  display: flex;
}

.like-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  margin-left: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: #fff;
}

.like-avatar:first-child {
  margin-left: 0;
}

.like-more {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-left: -6px;
}

/* ===== ЗАГРУЗКА ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.error-box {
  text-align: center;
  padding: 40px;
  color: var(--error);
  font-size: 0.9rem;
}

/* ===== РАДИО ===== */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-option {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}

.radio-option:hover {
  border-color: #bbb;
}

.radio-option.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}

.radio-option input {
  display: none;
}

.radio-circle {
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-radius: 50%;
  margin-right: 12px;
  position: relative;
  flex-shrink: 0;
}

.radio-option.selected .radio-circle {
  border-color: var(--accent);
}

.radio-option.selected .radio-circle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
}

.radio-label {
  font-size: 0.95rem;
}

/* ===== ФАЙЛЫ ===== */
.file-preview {
  margin-top: 8px;
  padding: 10px;
  background: #f5f5f5;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: #666;
  display: none;
}

.file-preview.has-file {
  display: flex;
  align-items: center;
  gap: 8px;
}

.file-preview .check {
  color: var(--success);
}

.file-preview .thumbnail {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

/* ===== ПРОГРЕСС ===== */
.progress-container {
  margin-bottom: 24px;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
}

/* ===== УТИЛИТЫ ===== */
.section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 20px 0 10px;
}

.step {
  display: none;
}

.step.active {
  display: block;
}

.disclaimer {
  padding: 14px 16px;
  background: #f5f5f5;
  border-radius: 10px;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 16px;
}

.existing-photo {
  margin-top: 8px;
}

.existing-photo img {
  width: 100%;
  border-radius: var(--radius-sm);
}

/* ===== АДАПТИВ ===== */
@media (max-width: 600px) {
  .module-grid {
    grid-template-columns: 1fr;
  }

  .auth-screen {
    padding: 40px 16px;
  }

  .app {
    padding: 16px;
  }

  .page-wrap {
    padding: 16px;
  }

  .header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .module-header {
    flex-wrap: wrap;
  }
}
