/* Brand Chief Design System */
:root {
    --navy: #1E2761;
    --navy-dark: #141D3B;
    --orange: #FF6B35;
    --gold: #F7C948;
    --gold-dark: #D4A84B;
    --charcoal: #2D2D2D;
    --slate: #64748B;
    --light-gray: #F8FAFC;
    --ice-blue: #F0F4FA;
    --red: #EF4444;
    --green: #22C55E;
    --white: #FFFFFF;
}

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

body {
    font-family: 'Segoe UI', Calibri, -apple-system, sans-serif;
    background: var(--light-gray);
    color: var(--charcoal);
    min-height: 100vh;
}

/* Login Screen */
.screen { min-height: 100vh; }

#login-screen {
    background: var(--navy);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: var(--navy-dark);
    border-radius: 12px;
    padding: 48px 40px;
    width: 400px;
    max-width: 90vw;
    text-align: center;
    border-top: 3px solid var(--gold);
}

.login-logo { height: 32px; margin-bottom: 24px; }

.login-container h2 {
    color: var(--white);
    font-family: Georgia, serif;
    font-size: 20px;
    margin-bottom: 32px;
    font-weight: normal;
}

.login-container input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
    color: var(--white);
    font-size: 14px;
    margin-bottom: 12px;
    outline: none;
    transition: border-color 0.2s;
}

.login-container input:focus { border-color: var(--gold); }
.login-container input::placeholder { color: var(--slate); }

.info-text { color: var(--slate); font-size: 13px; margin-bottom: 16px; }

.error-msg {
    color: var(--red);
    font-size: 13px;
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(239,68,68,0.1);
    border-radius: 6px;
}

.footer-text { color: var(--slate); font-size: 12px; margin-top: 24px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary { background: var(--orange); color: var(--white); }
.btn-primary:hover { background: #e55a28; }

.btn-outline {
    background: transparent;
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.3);
}
.btn-outline:hover { border-color: var(--white); }

.btn-large { padding: 14px 32px; font-size: 15px; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

.btn-gold { background: var(--gold); color: var(--navy); font-weight: 700; }
.btn-gold:hover { background: var(--gold-dark); }

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

/* Header */
header {
    background: var(--navy);
    padding: 0 24px;
    border-bottom: 3px solid var(--gold);
}

.header-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.header-logo { height: 24px; }
.header-right { display: flex; align-items: center; gap: 16px; }
.user-email { color: var(--slate); font-size: 13px; }

/* Main content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

.hero { text-align: center; margin-bottom: 32px; }
.hero h1 {
    font-family: Georgia, serif;
    color: var(--navy);
    font-size: 28px;
    margin-bottom: 8px;
}
.hero p { color: var(--slate); font-size: 15px; }

/* Tool Grid — 2x2 on desktop */
.tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.tool-card {
    display: flex;
    flex-direction: column;
}

.tool-card .form-group { flex: 0; }
.tool-card .checkbox-label { margin-top: auto; }
.tool-card .spacer { flex: 1; }

.card-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.btn-full {
    width: 100%;
    margin-top: 12px;
}

.input-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Segoe UI', Calibri, sans-serif;
    min-height: 80px;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}
.input-textarea:focus { border-color: var(--orange); }

.status-msg {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
}
.status-msg.success { background: #dcfce7; color: #166534; }
.status-msg.error { background: #fef2f2; color: #991b1b; }
.status-msg.pending { background: #fef9c3; color: #854d0e; }

/* Cards */
.card {
    background: var(--white);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.card h3 {
    font-family: Georgia, serif;
    color: var(--navy);
    font-size: 17px;
    margin-bottom: 16px;
}

/* Form */
.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
}

.input-brand {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid #E2E8F0;
    border-radius: 6px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.input-brand:focus { border-color: var(--orange); }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--slate);
    font-size: 13px;
    cursor: pointer;
}

/* Progress */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--ice-blue);
    border-radius: 3px;
    margin-bottom: 16px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--orange), var(--gold));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress-status { color: var(--slate); font-size: 13px; margin-bottom: 20px; }

.progress-steps { display: flex; flex-direction: column; gap: 10px; }

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--slate);
    font-size: 13px;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #E2E8F0;
    flex-shrink: 0;
    transition: background 0.3s;
}

.step.active .step-dot { background: var(--orange); }
.step.complete .step-dot { background: var(--green); }
.step.active { color: var(--charcoal); font-weight: 600; }
.step.complete { color: var(--green); }

/* Result */
.result-title { color: var(--green) !important; }

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

.result-brand {
    font-family: Georgia, serif;
    font-size: 24px;
    color: var(--navy);
    margin-bottom: 12px;
}

.result-stats {
    color: var(--slate);
    font-size: 14px;
    margin-bottom: 24px;
}

.result-actions { display: flex; gap: 12px; justify-content: center; }

.result-actions .btn-outline {
    color: var(--navy);
    border-color: #E2E8F0;
}
.result-actions .btn-outline:hover { border-color: var(--navy); }

/* History */
.history-list { display: flex; flex-direction: column; gap: 8px; }

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--ice-blue);
    border-radius: 6px;
}

.history-item-brand {
    font-weight: 600;
    color: var(--navy);
}

.history-item-date {
    color: var(--slate);
    font-size: 12px;
}

.history-item-actions { display: flex; gap: 8px; }

.empty-state { color: var(--slate); font-size: 13px; text-align: center; padding: 16px; }

/* Footer */
footer {
    text-align: center;
    padding: 24px;
    color: var(--slate);
    font-size: 12px;
}

/* Loading spinner on button */
.btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    margin-left: 8px;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Card header with help button */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-header h3 { margin-bottom: 0; }

.help-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--ice-blue);
    color: var(--navy);
    border: none;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.help-btn:hover {
    background: var(--orange);
    color: var(--white);
    transform: scale(1.1);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 29, 59, 0.75);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(4px);
}

.modal-box {
    background: var(--white);
    border-radius: 12px;
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px 36px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border-top: 4px solid var(--orange);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--slate);
    cursor: pointer;
    line-height: 1;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background 0.2s;
}
.modal-close:hover {
    background: var(--ice-blue);
    color: var(--navy);
}

#help-modal-content h2 {
    font-family: Georgia, serif;
    color: var(--navy);
    font-size: 22px;
    margin-bottom: 8px;
}

#help-modal-content .subtitle {
    color: var(--orange);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

#help-modal-content h4 {
    color: var(--navy);
    font-size: 14px;
    font-weight: 700;
    margin-top: 18px;
    margin-bottom: 8px;
}

#help-modal-content p,
#help-modal-content li {
    color: var(--charcoal);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 8px;
}

#help-modal-content ol,
#help-modal-content ul {
    padding-left: 22px;
    margin-bottom: 12px;
}

#help-modal-content .step {
    background: var(--ice-blue);
    border-left: 3px solid var(--orange);
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 10px;
}
#help-modal-content .step strong {
    color: var(--navy);
}

#help-modal-content .tip {
    background: #fef3c7;
    border-left: 3px solid var(--gold);
    padding: 10px 14px;
    border-radius: 4px;
    margin: 14px 0;
    font-size: 12px;
}
#help-modal-content .tip strong { color: #92400e; }

/* Form groups */
.form-group { margin-bottom: 4px; }
.input-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 6px;
}
.optional-tag {
    font-weight: 400;
    font-size: 11px;
    color: var(--slate);
    background: var(--ice-blue);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 6px;
}
.asin-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.input-asin {
    padding: 10px 14px;
    border: 2px solid #E2E8F0;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    outline: none;
    transition: border-color 0.2s;
}
.input-asin:focus { border-color: var(--orange); }

/* Section description */
.section-desc { color: var(--slate); font-size: 13px; margin-bottom: 16px; }

/* Upload area */
.upload-area { margin-bottom: 12px; }
.upload-row { margin-bottom: 10px; }
.upload-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px dashed #E2E8F0;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
    font-size: 14px;
    color: var(--charcoal);
}
.upload-label:hover { border-color: var(--orange); }
.upload-icon {
    width: 28px; height: 28px;
    background: var(--navy);
    color: var(--gold);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
    flex-shrink: 0;
}
.file-input { display: none; }
.file-name {
    margin-left: auto;
    font-size: 12px;
    color: var(--slate);
}
.file-name.selected { color: var(--green); font-weight: 600; }
.help-text {
    font-size: 11px;
    color: var(--slate);
    margin-top: 8px;
    font-style: italic;
}

/* POA Generator styles */
.poa-instructions {
    background: var(--ice-blue);
    border-left: 3px solid var(--gold);
    border-radius: 0 6px 6px 0;
    padding: 12px 14px;
    margin-bottom: 14px;
}
.poa-instructions-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 6px;
}
.poa-steps {
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
    color: var(--slate);
    line-height: 1.7;
}
.poa-steps li { margin-bottom: 2px; }
.poa-steps strong { color: var(--charcoal); }

.input-file {
    width: 100%;
    padding: 8px;
    border: 2px dashed #E2E8F0;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.input-file:hover { border-color: var(--orange); }

.poa-result-textarea {
    width: 100%;
    min-height: 400px;
    padding: 16px;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    resize: vertical;
    margin-bottom: 16px;
    background: #FAFBFC;
    color: var(--charcoal);
}

/* Program Map Page */
.map-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.map-stat {
    background: var(--navy);
    color: var(--white);
    border-radius: 8px;
    padding: 16px 24px;
    text-align: center;
    min-width: 110px;
    border-bottom: 3px solid var(--gold);
}
.stat-num {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--gold);
    font-family: Georgia, serif;
}
.stat-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
    color: rgba(255,255,255,0.7);
}

.map-section { margin-bottom: 36px; }
.map-section-title {
    font-family: Georgia, serif;
    color: var(--navy);
    font-size: 20px;
    margin-bottom: 4px;
}
.map-section-desc {
    color: var(--slate);
    font-size: 13px;
    margin-bottom: 16px;
}

.map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.marketplace-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.map-card {
    background: var(--white);
    border-radius: 8px;
    padding: 18px;
    border-left: 4px solid #ccc;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: transform 0.15s, box-shadow 0.15s;
}
.map-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.map-card.skill { border-left-color: var(--orange); }
.map-card.agent { border-left-color: var(--green); }
.map-card.lambda { border-left-color: #8B5CF6; }
.map-card.script { border-left-color: var(--gold); }
.map-card.marketplace { border-left-color: var(--navy); text-align: center; }

.map-card-icon { font-size: 24px; margin-bottom: 6px; }
.map-card h4 {
    font-size: 14px;
    color: var(--navy);
    margin-bottom: 6px;
}
.map-card p {
    font-size: 12px;
    color: var(--slate);
    line-height: 1.5;
    margin: 0;
}

.map-nav-card {
    border-top: 3px solid var(--gold);
}

/* Responsive — stack on mobile */
@media (max-width: 900px) {
    .tool-grid {
        grid-template-columns: 1fr;
    }
    .form-row { flex-direction: column; }
    .result-actions { flex-direction: column; }
    .hero h1 { font-size: 22px; }
    .map-grid {
        grid-template-columns: 1fr;
    }
    .map-stats {
        gap: 10px;
    }
    .map-stat {
        min-width: 80px;
        padding: 12px 14px;
    }
    .stat-num { font-size: 22px; }
}

@media (max-width: 600px) {
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 0;
        gap: 8px;
    }
    .header-right {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .user-email {
        display: none;
    }
    .header-logo { height: 20px; }
    main { padding: 16px 12px; }
    .hero { margin-bottom: 20px; }
    .hero h1 { font-size: 20px; }
    .hero p { font-size: 13px; }
    .card { padding: 16px; }
    .map-stats { gap: 6px; }
    .map-stat {
        min-width: 60px;
        padding: 10px 8px;
    }
    .stat-num { font-size: 18px; }
    .stat-label { font-size: 9px; }
    .map-section-title { font-size: 17px; }
}
