/* ═══════════════════════════════════════════════════════════
   WRRNTY - BRUTALIST STYLE
   ═══════════════════════════════════════════════════════════ */

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

:root {
  --black: #000000;
  --white: #ffffff;
  --gray: #888888;
  --light-gray: #f0f0f0;
  --border: 2px solid var(--black);
  --font-mono: 'Courier New', Courier, monospace;
}

html { font-size: 16px; }

body {
  font-family: var(--font-mono);
  background: var(--white);
  color: var(--black);
  min-height: 100vh;
  line-height: 1.4;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}

header {
  text-align: center;
  padding: 1.5rem 0;
  border-bottom: var(--border);
  margin-bottom: 1rem;
}

header h1 {
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.tagline {
  font-size: 0.875rem;
  color: var(--gray);
}

.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
}

.tab {
  flex: 1;
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: bold;
  background: var(--white);
  border: var(--border);
  cursor: pointer;
  transition: all 0.1s ease;
}

.tab:first-child { border-right: none; }
.tab:hover { background: var(--light-gray); }
.tab.active { background: var(--black); color: var(--white); }

.view { display: none; }
.view.active { display: block; }

.form-section { margin-bottom: 2rem; }

.form-section h2 {
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.15em;
  color: var(--gray);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--light-gray);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.photo-upload {
  position: relative;
  aspect-ratio: 1;
  border: var(--border);
  border-style: dashed;
  overflow: hidden;
}

.photo-upload input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}

.photo-upload label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0.5rem;
  text-align: center;
}

.photo-icon { font-size: 1.5rem; margin-bottom: 0.25rem; }
.photo-label { font-size: 0.625rem; font-weight: bold; letter-spacing: 0.05em; }
.photo-hint { font-size: 0.5rem; color: var(--gray); margin-top: 0.125rem; }

.photo-preview {
  position: absolute;
  inset: 0;
  display: none;
  z-index: 1;
}

.photo-preview img { width: 100%; height: 100%; object-fit: cover; }

.photo-preview .remove-photo {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--black);
  color: var(--white);
  border: none;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.photo-upload.has-photo .photo-preview { display: block; }
.photo-upload.has-photo label { display: none; }

.form-field { margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.form-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.05em;
  margin-bottom: 0.375rem;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  border: var(--border);
  background: var(--white);
  color: var(--black);
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  background: var(--light-gray);
}

.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--gray); }

.form-field input[type="date"] { -webkit-appearance: none; appearance: none; }

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}

.btn {
  width: 100%;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  border: var(--border);
  cursor: pointer;
  transition: all 0.1s ease;
}

.btn-primary { background: var(--black); color: var(--white); }
.btn-primary:hover { background: var(--gray); }
.btn-primary:active { transform: scale(0.98); }
.btn-secondary { background: var(--white); color: var(--black); }
.btn-secondary:hover { background: var(--light-gray); }

.warranty-list { min-height: 200px; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray);
  font-size: 0.875rem;
}

.warranty-item {
  border: var(--border);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.warranty-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.warranty-item-name { font-weight: bold; font-size: 1rem; }

.warranty-item-status {
  font-size: 0.625rem;
  font-weight: bold;
  padding: 0.25rem 0.5rem;
  letter-spacing: 0.05em;
}

.warranty-item-status.active { background: var(--black); color: var(--white); }
.warranty-item-status.expired { background: var(--light-gray); color: var(--gray); }

.warranty-item-details {
  font-size: 0.75rem;
  color: var(--gray);
  margin-bottom: 0.75rem;
}

.warranty-item-details span { display: block; margin-bottom: 0.125rem; }

.warranty-item-actions { display: flex; gap: 0.5rem; }

.warranty-item-actions button {
  flex: 1;
  padding: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: bold;
  letter-spacing: 0.05em;
  border: 1px solid var(--black);
  background: var(--white);
  cursor: pointer;
}

.warranty-item-actions button:hover { background: var(--light-gray); }
.warranty-item-actions button.delete { border-color: var(--gray); color: var(--gray); }

footer {
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: var(--border);
  text-align: center;
  font-size: 0.75rem;
  color: var(--gray);
}

.footer-note { margin-top: 0.25rem; font-size: 0.625rem; }

.toast {
  position: fixed;
  bottom: calc(2rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--black);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-family: var(--font-mono);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
  max-width: 90%;
  text-align: center;
}

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

@media (max-width: 400px) {
  .photo-grid { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
  .photo-icon { font-size: 1.25rem; }
  .photo-label { font-size: 0.5rem; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
}

@supports (padding: env(safe-area-inset-top)) {
  header { padding-top: calc(1.5rem + env(safe-area-inset-top)); }
}

.footer-links { margin-top: 0.5rem; }
.footer-links a { color: var(--gray); text-decoration: none; font-size: 0.625rem; }
.footer-links a:hover { color: var(--black); }
.legal-content { line-height: 1.6; }
.legal-content h1 { font-size: 1.25rem; margin: 2rem 0 1rem 0; border-bottom: var(--border); padding-bottom: 0.5rem; }
.legal-content h2 { font-size: 1rem; margin: 1.5rem 0 0.75rem 0; }
.legal-content p, .legal-content ul { margin-bottom: 0.75rem; font-size: 0.875rem; }
.legal-content ul { padding-left: 1.5rem; }
.legal-content a { color: var(--black); }
.tldr { background: var(--light-gray); padding: 1rem; margin: 1rem 0; font-size: 0.875rem; }
.back-link { color: var(--gray); text-decoration: none; font-size: 0.75rem; }
.back-link:hover { color: var(--black); }

