/* ========================================
   50 — Das neue 49 | Design System
   ======================================== */

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

/* --- Custom Properties --- */
:root {
  --white:       #ffffff;
  --off-white:   #f8f7f4;
  --light-gray:  #f0eee9;
  --mid-gray:    #9e9b94;
  --dark:        #1a1917;
  --accent:      #c8a96e;
  --accent-dark: #a8874a;
  --border:      #e8e5df;
  --text:        #1a1917;
  --text-muted:  #9e9b94;
  --error:       #c0392b;
  --success:     #2d7a4f;
  --warning:     #d4a017;
  --radius-card: 12px;
  --radius-input: 8px;
  --shadow:      0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.1);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--off-white);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* --- Typography --- */
h1, h2, h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  line-height: 1.2;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }

p { margin-bottom: 0.75rem; }

.text-muted {
  color: var(--text-muted);
  font-size: 0.875rem;
}

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

/* --- Mobile Nav Bar --- */
.mobile-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.mobile-nav-back {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  text-decoration: none;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.25rem 0;
  min-width: 44px;
  min-height: 44px;
}

.mobile-nav-back:active {
  opacity: 0.6;
}

.mobile-nav-back-arrow {
  font-size: 1.25rem;
  line-height: 1;
}

.mobile-nav-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.mobile-nav-right {
  min-width: 44px;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-header {
  text-align: center;
  padding: 1.5rem 0 1rem;
}

.page-content {
  flex: 1;
}

/* --- Logo --- */
.logo {
  display: inline-block;
  text-align: center;
  margin-bottom: 0.5rem;
}

.logo-number {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -1px;
}

.logo-subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 0.125rem;
}

/* --- Cards --- */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-input);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1;
  width: 100%;
}

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

.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

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

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--mid-gray);
  background: var(--light-gray);
}

.btn-success {
  background: var(--success);
  color: var(--white);
  border-color: var(--success);
}

.btn-danger {
  background: var(--error);
  color: var(--white);
  border-color: var(--error);
}

.btn-sm {
  font-size: 0.8125rem;
  padding: 0.5rem 1rem;
  width: auto;
}

/* --- Form Elements --- */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: var(--text);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 0.875rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 169, 110, 0.15);
}

.form-input::placeholder {
  color: var(--mid-gray);
}

.form-select {
  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='%239e9b94' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
}

/* --- Password Toggle --- */
.pw-wrapper {
  position: relative;
}

.pw-wrapper .form-input {
  padding-right: 2.75rem;
}

.pw-toggle {
  position: absolute;
  right: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--mid-gray);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.pw-toggle:hover {
  color: var(--text);
}

.pw-toggle svg {
  width: 20px;
  height: 20px;
}

.form-error {
  font-size: 0.8125rem;
  color: var(--error);
  margin-top: 0.25rem;
}

/* --- Toggle / Checkbox --- */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
}

.toggle-input {
  width: 44px;
  height: 24px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--light-gray);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.toggle-input::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
}

.toggle-input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-input:checked::before {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 0.9375rem;
  cursor: pointer;
}

/* --- Badges --- */
.badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-pending {
  background: var(--light-gray);
  color: var(--mid-gray);
}

.badge-confirmed {
  background: #e8f5e9;
  color: var(--success);
}

.badge-rejected {
  background: #fde8e8;
  color: var(--error);
}

.badge-checkedin {
  background: #e3f0fc;
  color: #1a6fb5;
}

/* --- Tabs --- */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.tab {
  flex: 1;
  padding: 0.75rem 0.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* --- Status Screens --- */
.status-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.75rem;
}

.status-icon-success {
  background: #e8f5e9;
  color: var(--success);
}

.status-icon-error {
  background: #fde8e8;
  color: var(--error);
}

.status-icon-warning {
  background: #fef9e7;
  color: var(--warning);
}

/* --- Scan Result --- */
.scan-result {
  padding: 1rem;
  border-radius: var(--radius-card);
  text-align: center;
  margin: 1rem 0;
  display: none;
}

.scan-result.show { display: block; }

.scan-result-valid {
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
}

.scan-result-invalid {
  background: #fde8e8;
  border: 1px solid #f5c6c6;
}

.scan-result-warning {
  background: #fef9e7;
  border: 1px solid #f5e6a3;
}

/* --- Search --- */
.search-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

.search-input {
  width: 100%;
  padding: 0.75rem 0.875rem 0.75rem 2.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mid-gray);
  font-size: 0.875rem;
}

/* --- Guest List Item --- */
.guest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.guest-item:last-child {
  border-bottom: none;
}

.guest-name {
  font-weight: 600;
  font-size: 0.9375rem;
}

.guest-info {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* --- Separator --- */
.separator {
  height: 1px;
  background: var(--border);
  margin: 1.25rem 0;
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

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

.fade-in-up {
  animation: fadeInUp 0.5s ease forwards;
}

/* --- Hidden Utility --- */
.hidden { display: none !important; }

/* --- Video (QR Scanner) --- */
.scanner-video {
  width: 100%;
  border-radius: var(--radius-card);
  background: var(--dark);
  aspect-ratio: 4/3;
  object-fit: cover;
}

.scanner-canvas {
  display: none;
}

/* --- Ticket --- */
.ticket-wrapper {
  text-align: center;
}

.ticket-image {
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
}

/* --- Instructions --- */
.instructions {
  background: var(--light-gray);
  border-radius: var(--radius-card);
  padding: 1rem;
  margin-top: 1rem;
}

.instructions ol {
  padding-left: 1.25rem;
  margin: 0;
}

.instructions li {
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

/* --- Responsive fine-tuning --- */
@media (min-width: 481px) {
  .container {
    padding: 2rem 1.5rem;
  }
  h1 { font-size: 2rem; }
}
