/* WarrantyVault - Mobile-first stylesheet */
:root {
    --teal-900: #134e4a;
    --teal-800: #115e59;
    --teal-700: #0f766e;
    --teal-600: #0d9488;
    --teal-500: #14b8a6;
    --teal-400: #2dd4bf;
    --teal-100: #ccfbf1;
    --teal-50:  #f0fdfa;
    --amber-500: #f59e0b;
    --amber-400: #fbbf24;
    --amber-100: #fef3c7;
    --amber-50:  #fffbeb;
    --red-600:  #dc2626;
    --red-100:  #fee2e2;
    --green-600: #16a34a;
    --green-100: #dcfce7;
    --grey-50:  #f9fafb;
    --grey-100: #f3f4f6;
    --grey-200: #e5e7eb;
    --grey-300: #d1d5db;
    --grey-500: #6b7280;
    --grey-700: #374151;
    --grey-900: #111827;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.10);
    --shadow:    0 4px 12px rgba(0,0,0,.10);
    --radius:    12px;
    --radius-sm: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--grey-50);
    color: var(--grey-900);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.5;
}

/* ---- TOPBAR ---- */
.topbar {
    background: linear-gradient(135deg, var(--teal-800), var(--teal-600));
    color: white;
    padding: 0 16px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.topbar-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
.topbar-logo .icon { font-size: 22px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.topbar-actions a { color: rgba(255,255,255,.85); text-decoration: none; font-size: 13px; }
.topbar-actions a:hover { color: white; }
.btn-topbar {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn-topbar:hover { background: rgba(255,255,255,.25); }

/* ---- CONTENT ---- */
.container { max-width: 680px; margin: 0 auto; padding: 16px; }

/* ---- CARDS ---- */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 14px;
}
.card-header {
    padding: 14px 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h2 { font-size: 16px; font-weight: 700; color: var(--teal-800); }
.card-body { padding: 14px 16px; }

/* ---- STAT GRID ---- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border-top: 3px solid var(--teal-500);
}
.stat-card.red    { border-color: var(--red-600); }
.stat-card.amber  { border-color: var(--amber-500); }
.stat-card.green  { border-color: var(--green-600); }
.stat-value { font-size: 28px; font-weight: 800; color: var(--teal-700); line-height: 1; }
.stat-card.red   .stat-value { color: var(--red-600); }
.stat-card.amber .stat-value { color: var(--amber-500); }
.stat-card.green .stat-value { color: var(--green-600); }
.stat-label { font-size: 12px; color: var(--grey-500); margin-top: 4px; }

/* ---- ITEM LIST ---- */
.item-list { list-style: none; }
.item-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--grey-100);
    cursor: pointer;
    transition: background .15s;
    text-decoration: none;
    color: inherit;
}
.item-card:last-child { border-bottom: none; }
.item-card:hover, .item-card:active { background: var(--teal-50); }

.item-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--grey-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--teal-400);
}
.item-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }

.item-info { flex: 1; min-width: 0; }
.item-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sub  { font-size: 12px; color: var(--grey-500); margin-top: 2px; }
.item-meta { display: flex; gap: 8px; align-items: center; margin-top: 5px; flex-wrap: wrap; }

/* ---- BADGES ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-expired  { background: var(--red-100);   color: var(--red-600); }
.badge-soon     { background: var(--amber-100); color: #92400e; }
.badge-active   { background: var(--green-100); color: var(--green-600); }
.badge-none     { background: var(--grey-100);  color: var(--grey-500); }
.badge-category { background: var(--teal-100);  color: var(--teal-800); }

/* ---- FORMS ---- */
.form-group { margin-bottom: 14px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--grey-700);
    margin-bottom: 5px;
}
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--grey-200);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--grey-900);
    background: white;
    transition: border-color .15s, box-shadow .15s;
    appearance: none;
}
.form-control:focus {
    outline: none;
    border-color: var(--teal-500);
    box-shadow: 0 0 0 3px rgba(20,184,166,.15);
}
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 20px; padding-right: 36px; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 12px; color: var(--grey-500); margin-top: 4px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
}
.btn-primary   { background: var(--teal-600); color: white; }
.btn-primary:hover   { background: var(--teal-700); }
.btn-secondary { background: var(--grey-100); color: var(--grey-700); }
.btn-secondary:hover { background: var(--grey-200); }
.btn-danger    { background: var(--red-100); color: var(--red-600); }
.btn-danger:hover    { background: #fecaca; }
.btn-amber     { background: var(--amber-100); color: #92400e; }
.btn-full      { width: 100%; }
.btn-sm        { padding: 7px 14px; font-size: 13px; }

.btn-fab {
    position: fixed;
    bottom: 24px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--teal-600);
    color: white;
    font-size: 26px;
    box-shadow: 0 4px 14px rgba(13,148,136,.4);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 50;
    transition: all .2s;
}
.btn-fab:hover { background: var(--teal-700); transform: scale(1.08); }

/* ---- ALERTS ---- */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.alert-error   { background: var(--red-100);   color: #7f1d1d; border-left: 3px solid var(--red-600); }
.alert-success { background: var(--green-100); color: #14532d; border-left: 3px solid var(--green-600); }
.alert-warning { background: var(--amber-100); color: #78350f; border-left: 3px solid var(--amber-500); }
.alert-info    { background: var(--teal-50);   color: var(--teal-900); border-left: 3px solid var(--teal-500); }

/* ---- LANDING ---- */
.landing {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.landing-hero {
    background: linear-gradient(135deg, var(--teal-800) 0%, var(--teal-600) 60%, var(--amber-500) 100%);
    color: white;
    padding: 48px 24px 40px;
    text-align: center;
}
.landing-hero .logo-big { font-size: 52px; margin-bottom: 12px; }
.landing-hero h1 { font-size: 28px; font-weight: 800; line-height: 1.2; margin-bottom: 12px; }
.landing-hero p  { font-size: 16px; opacity: .9; max-width: 400px; margin: 0 auto 28px; }
.landing-hero .cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-hero-primary   { background: white; color: var(--teal-700); font-weight: 700; }
.btn-hero-secondary { background: rgba(255,255,255,.15); color: white; border: 2px solid rgba(255,255,255,.4); }

.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 20px 16px;
}
.feature-item {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}
.feature-item .icon { font-size: 30px; margin-bottom: 8px; }
.feature-item h3 { font-size: 13px; font-weight: 700; color: var(--teal-800); margin-bottom: 4px; }
.feature-item p  { font-size: 12px; color: var(--grey-500); }

/* ---- AUTH PAGES ---- */
.auth-wrap {
    max-width: 400px;
    margin: 24px auto;
    padding: 0 16px;
}
.auth-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 24px;
}
.auth-logo { text-align: center; margin-bottom: 20px; }
.auth-logo .icon { font-size: 40px; }
.auth-logo h1 { font-size: 22px; font-weight: 800; color: var(--teal-700); margin-top: 4px; }
.auth-logo p  { font-size: 13px; color: var(--grey-500); }

.code-input-row { display: flex; gap: 8px; justify-content: center; margin: 16px 0; }
.code-digit {
    width: 44px;
    height: 52px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    border: 2px solid var(--grey-200);
    border-radius: var(--radius-sm);
    background: white;
}
.code-digit:focus { border-color: var(--teal-500); outline: none; box-shadow: 0 0 0 3px rgba(20,184,166,.15); }

/* ---- TABS ---- */
.tab-bar {
    display: flex;
    background: var(--grey-100);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 16px;
    gap: 2px;
}
.tab-btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--grey-500);
    cursor: pointer;
    transition: all .15s;
}
.tab-btn.active { background: white; color: var(--teal-700); box-shadow: var(--shadow-sm); }

/* ---- SEARCH ---- */
.search-bar {
    position: relative;
    margin-bottom: 14px;
}
.search-bar input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    border: 1.5px solid var(--grey-200);
    border-radius: 24px;
    font-size: 14px;
    background: white;
}
.search-bar input:focus { outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(20,184,166,.15); }
.search-bar .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--grey-400);
    pointer-events: none;
}

/* ---- FILTER CHIPS ---- */
.filter-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1.5px solid var(--grey-200);
    background: white;
    color: var(--grey-600);
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.chip.active { background: var(--teal-600); color: white; border-color: var(--teal-600); }
.chip:hover  { border-color: var(--teal-400); }

/* ---- ITEM DETAIL ---- */
.detail-image {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    background: var(--grey-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
}
.detail-section { padding: 16px; border-bottom: 1px solid var(--grey-100); }
.detail-section:last-child { border-bottom: none; }
.detail-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.detail-key   { font-size: 12px; color: var(--grey-500); }
.detail-value { font-size: 14px; font-weight: 600; text-align: right; max-width: 60%; }

.expiry-banner {
    padding: 14px 16px;
    font-weight: 700;
    font-size: 15px;
    text-align: center;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
}
.expiry-banner.expired  { background: var(--red-100);   color: var(--red-600); }
.expiry-banner.soon     { background: var(--amber-100); color: #92400e; }
.expiry-banner.active   { background: var(--green-100); color: var(--green-600); }
.expiry-banner.none     { background: var(--grey-100);  color: var(--grey-500); }

/* ---- UPLOAD ZONE ---- */
.upload-zone {
    border: 2px dashed var(--grey-300);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
    background: var(--grey-50);
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--teal-500); background: var(--teal-50); }
.upload-zone .icon { font-size: 32px; margin-bottom: 6px; }
.upload-zone p  { font-size: 13px; color: var(--grey-500); }
.upload-preview { margin-top: 10px; }
.upload-preview img { max-width: 100%; max-height: 160px; border-radius: var(--radius-sm); object-fit: contain; }

/* ---- SECTION HEADING ---- */
.section-heading {
    font-size: 13px;
    font-weight: 700;
    color: var(--grey-500);
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 10px 16px 6px;
}

/* ---- EMPTY STATE ---- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--grey-500); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: .5; }
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--grey-700); margin-bottom: 6px; }
.empty-state p  { font-size: 14px; }

/* ---- MODAL ---- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.modal {
    background: white;
    border-radius: var(--radius) var(--radius) 0 0;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
    animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-handle { width: 36px; height: 4px; background: var(--grey-300); border-radius: 2px; margin: 0 auto 16px; }

/* ---- BOTTOM NAV ---- */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: white;
    border-top: 1px solid var(--grey-200);
    display: flex;
    z-index: 90;
    padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0 6px;
    font-size: 10px;
    font-weight: 600;
    color: var(--grey-500);
    text-decoration: none;
    gap: 3px;
    transition: color .15s;
}
.bottom-nav a .nav-icon { font-size: 22px; }
.bottom-nav a.active, .bottom-nav a:hover { color: var(--teal-600); }
.page-content { padding-bottom: 70px; }

/* ---- FOOTER ---- */
.footer {
    text-align: center;
    padding: 20px 16px 90px;
    font-size: 12px;
    color: var(--grey-400);
}
.footer a { color: var(--teal-600); text-decoration: none; }
.footer .bmac { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; background: var(--amber-100); color: #92400e; padding: 6px 14px; border-radius: 20px; font-weight: 600; font-size: 13px; }

/* ---- HELP / PRIVACY ---- */
.prose h2 { font-size: 17px; font-weight: 700; color: var(--teal-800); margin: 20px 0 8px; }
.prose h3 { font-size: 14px; font-weight: 700; color: var(--grey-700); margin: 14px 0 6px; }
.prose p  { font-size: 14px; color: var(--grey-700); margin-bottom: 10px; line-height: 1.6; }
.prose ul { padding-left: 18px; margin-bottom: 10px; }
.prose li { font-size: 14px; color: var(--grey-700); margin-bottom: 4px; }

/* ---- UTILITIES ---- */
.text-muted   { color: var(--grey-500); font-size: 13px; }
.text-center  { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-0  { margin-bottom: 0; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-gap     { display: flex; gap: 8px; }
.hidden { display: none !important; }

@media (min-width: 480px) {
    .stat-grid { grid-template-columns: repeat(4, 1fr); }
    .feature-grid { grid-template-columns: repeat(3, 1fr); }
}
