/* ============================================================
   Insurance Rater — Minimal Black & White Design System
   ============================================================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #111;
    background: #f7f7f7;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1 { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 600; }

/* ============================================================
   AUTH PAGES (Login / Signup)
   ============================================================ */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #f7f7f7;
}

.auth-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
}

.auth-card h1 {
    font-size: 15px;
    font-weight: 600;
    color: #888;
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.auth-card h2 {
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    color: #111;
    margin-bottom: 32px;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: #888;
    font-size: 13px;
}

.auth-switch a {
    color: #111;
    font-weight: 600;
    text-decoration: underline;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: #444;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    color: #111;
    background: #fff;
    transition: border-color 0.15s;
    appearance: auto;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #111;
}

.form-group input[readonly] {
    background: #f4f4f4;
    color: #777;
    cursor: not-allowed;
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #888;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 0;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: #111;
    color: #fff;
    border: 1px solid #111;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
}

.btn-primary:hover { background: #333; }
.btn-primary:disabled { background: #aaa; border-color: #aaa; cursor: not-allowed; }

.btn-secondary {
    display: inline-block;
    padding: 9px 18px;
    background: #fff;
    color: #111;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
    font-family: inherit;
}

.btn-secondary:hover { border-color: #111; background: #f7f7f7; }

.btn-success {
    display: inline-block;
    padding: 11px 28px;
    background: #111;
    color: #fff;
    border: 1px solid #111;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

.btn-success:hover { background: #333; }
.btn-success:disabled { background: #aaa; border-color: #aaa; cursor: not-allowed; }

.btn-large {
    padding: 13px 36px;
    font-size: 15px;
    margin: 20px 0;
}

.btn-logout {
    display: inline-block;
    padding: 7px 16px;
    background: transparent;
    color: #111;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.15s;
    font-family: inherit;
}

.btn-logout:hover { border-color: #111; }

/* Action buttons on cards */
.btn-approve {
    padding: 7px 14px;
    background: #fff;
    color: #111;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.btn-approve:hover { background: #111; color: #fff; border-color: #111; }

.btn-deny {
    padding: 7px 14px;
    background: #fff;
    color: #111;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.btn-deny:hover { background: #111; color: #fff; border-color: #111; }

.btn-pending {
    padding: 7px 14px;
    background: #fff;
    color: #111;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.btn-pending:hover { background: #111; color: #fff; border-color: #111; }

.btn-edit {
    padding: 7px 14px;
    background: #fff;
    color: #111;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-block;
    font-family: inherit;
}
.btn-edit:hover { background: #111; color: #fff; border-color: #111; }

.btn-pdf {
    padding: 7px 14px;
    background: #fff;
    color: #111;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.btn-pdf:hover { background: #111; color: #fff; border-color: #111; }

/* ============================================================
   MESSAGES
   ============================================================ */
.error-message {
    background: #fff;
    color: #b00;
    border: 1px solid #f0c0c0;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 13px;
    display: none;
}

.success-message {
    background: #fff;
    color: #111;
    border: 1px solid #c8e6c9;
    padding: 10px 14px;
    border-radius: 4px;
    margin-top: 14px;
    font-size: 13px;
}

/* ============================================================
   TOP NAV
   ============================================================ */
.top-menu {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    padding: 0 32px;
    height: 56px;
    gap: 0;
}

.menu-brand h1 {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    white-space: nowrap;
    padding-right: 32px;
    border-right: 1px solid #e8e8e8;
    line-height: 56px;
}

.menu-links {
    display: flex;
    align-items: center;
    flex: 1;
    padding-left: 8px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 18px;
    height: 56px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.menu-link:hover { color: #111; }

.menu-link.active {
    color: #111;
    border-bottom-color: #111;
    font-weight: 600;
}

.menu-icon { font-size: 14px; }

.menu-user {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
    padding-left: 24px;
    border-left: 1px solid #e8e8e8;
}

.user-email {
    font-size: 13px;
    color: #666;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.dashboard-container {
    min-height: 100vh;
    background: #f7f7f7;
}

.dashboard-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 36px 32px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #111;
    margin: 0;
}

.page-subtitle {
    font-size: 13px;
    color: #888;
    margin-top: 3px;
}

/* ============================================================
   FORM SECTIONS
   ============================================================ */
.form-section {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 28px 32px;
    margin-bottom: 20px;
}

.form-section h2 {
    font-size: 14px;
    font-weight: 700;
    color: #111;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid #ececec;
}

.form-section h3 {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin: 16px 0 12px;
}

.info-display {
    background: #f9f9f9;
    border: 1px solid #ececec;
    border-radius: 4px;
    padding: 14px 18px;
    margin-top: 16px;
    font-size: 13px;
    color: #555;
}

.info-display p { margin: 4px 0; }
.info-display strong { color: #111; }

/* ============================================================
   PREMIUM RESULT
   ============================================================ */
.premium-result {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 24px;
    margin-top: 20px;
}

.premium-result h3 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #888;
    margin-bottom: 16px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.result-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.result-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
}

.result-value {
    font-size: 16px;
    font-weight: 600;
    color: #111;
}

.result-item.highlight {
    background: #111;
    border-radius: 4px;
    padding: 12px 16px;
}

.result-item.highlight .result-label { color: #aaa; }
.result-item.highlight .result-value { color: #fff; font-size: 20px; font-weight: 700; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input,
.filter-select {
    padding: 9px 14px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    color: #111;
    background: #fff;
    transition: border-color 0.15s;
}

.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #111;
}

.search-input { min-width: 260px; }

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* ============================================================
   APPLICATION CARDS
   ============================================================ */
.applications-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.application-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.15s;
}

.application-card:hover { border-color: #bbb; }

/* Status left border */
.application-card.approved { border-left: 3px solid #111; }
.application-card.denied   { border-left: 3px solid #aaa; }
.application-card.pending  { border-left: 3px solid #ddd; }

.app-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
}

.app-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #111;
}

.app-card-id {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.app-card-body {
    padding: 14px 20px;
}

.app-card-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.info-item {
    font-size: 13px;
    color: #666;
}

.info-item strong { color: #111; }

.app-card-actions {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-badge.approved { background: #f0f0f0; color: #111; }
.status-badge.denied   { background: #f0f0f0; color: #888; }
.status-badge.pending  { background: #f0f0f0; color: #aaa; }

/* ============================================================
   STATS (Dashboard)
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card.approved { border-top: 3px solid #111; }
.stat-card.denied   { border-top: 3px solid #aaa; }
.stat-card.pending  { border-top: 3px solid #ddd; }

.stat-icon {
    font-size: 28px;
    opacity: 0.6;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #111;
    line-height: 1;
}

/* ============================================================
   QUICK ACTIONS (Dashboard)
   ============================================================ */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.action-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 28px 24px;
    text-decoration: none;
    color: #111;
    transition: border-color 0.15s;
    text-align: center;
    display: block;
}

.action-card:hover { border-color: #111; }

.action-icon { font-size: 32px; margin-bottom: 12px; }

.action-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; color: #111; }
.action-card p  { font-size: 13px; color: #888; margin: 0; }

/* ============================================================
   HELP GRID (Dashboard)
   ============================================================ */
.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.help-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 22px 24px;
}

.help-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 6px; color: #111; }
.help-card p  { font-size: 13px; color: #888; margin: 0; line-height: 1.6; }

/* ============================================================
   MODAL
   ============================================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    overflow: auto;
    background: rgba(0,0,0,0.45);
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-content {
    background: #fff;
    margin: 48px auto;
    border-radius: 6px;
    width: 90%;
    max-width: 860px;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideIn 0.2s;
    border: 1px solid #e0e0e0;
}

@keyframes slideIn {
    from { transform: translateY(-24px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    border-bottom: 1px solid #e8e8e8;
}

.modal-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    margin: 0;
}

.modal-close {
    font-size: 22px;
    font-weight: 400;
    cursor: pointer;
    color: #999;
    line-height: 1;
    transition: color 0.15s;
}

.modal-close:hover { color: #111; }

.modal-body { padding: 28px; }

/* Detail sections inside modal */
.detail-section { margin-bottom: 28px; }

.detail-section h3 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #888;
    padding-bottom: 10px;
    border-bottom: 1px solid #ececec;
    margin-bottom: 16px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.detail-item { padding: 8px 0; }

.detail-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #999;
    margin-bottom: 3px;
}

.detail-value { font-size: 14px; color: #111; }

/* ============================================================
   COMMENTS
   ============================================================ */
.comments-section {
    background: #f9f9f9;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 22px;
    margin-top: 16px;
}

.comment-form { margin-bottom: 20px; }

.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 90px;
    color: #111;
}

.comment-form textarea:focus { outline: none; border-color: #111; }

.comment-item {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    padding: 14px 16px;
    margin-bottom: 10px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-author { font-size: 13px; font-weight: 600; color: #111; }
.comment-date   { font-size: 11px; color: #aaa; }
.comment-text   { font-size: 13px; color: #555; line-height: 1.6; }

.comment-delete {
    font-size: 11px;
    color: #aaa;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 6px;
    display: inline-block;
}

.comment-delete:hover { color: #111; }

/* ============================================================
   LOADING / EMPTY STATE
   ============================================================ */
.loading-text {
    text-align: center;
    color: #aaa;
    font-size: 14px;
    padding: 60px 20px;
}

/* ============================================================
   PRODUCT BADGES (on cards)
   ============================================================ */
.product-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: #f0f0f0;
    color: #666;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .top-menu {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 16px;
        gap: 8px;
    }

    .menu-brand h1 {
        border-right: none;
        padding-right: 0;
        line-height: 1.4;
    }

    .menu-links {
        width: 100%;
        padding-left: 0;
        flex-wrap: wrap;
        border-top: 1px solid #eee;
        padding-top: 8px;
    }

    .menu-link { padding: 8px 12px; height: auto; }

    .menu-user {
        width: 100%;
        border-left: none;
        border-top: 1px solid #eee;
        padding: 10px 0 0;
    }

    .dashboard-content { padding: 20px 16px; }

    .form-row { grid-template-columns: 1fr; }

    .app-card-info { grid-template-columns: 1fr 1fr; }

    .app-card-actions button { flex: 1; min-width: 100px; }

    .modal-content { margin: 16px; width: calc(100% - 32px); max-height: calc(100vh - 32px); }

    .modal-body { padding: 20px; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .app-card-info { grid-template-columns: 1fr; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    .top-menu,
    .filter-bar,
    .app-card-actions,
    .btn-logout { display: none; }
}

/* ============================================================
   QUOTE BUTTONS
   ============================================================ */
.btn-quote {
    padding: 7px 14px;
    background: #111;
    color: #fff;
    border: 1px solid #111;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
    white-space: nowrap;
}

.btn-quote:hover { background: #333; }

.btn-quote-generating {
    padding: 7px 14px;
    background: #f4f4f4;
    color: #999;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: not-allowed;
    font-family: inherit;
    white-space: nowrap;
}

.btn-quote-ready {
    display: inline-block;
    padding: 7px 14px;
    background: #fff;
    color: #111;
    border: 1px solid #111;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    font-family: inherit;
}

.btn-quote-ready:hover { background: #111; color: #fff; }
