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

:root {
    --bg: #0a0a1a;
    --card: #12121f;
    --card2: #16162a;
    --gold: #c9a84c;
    --gold-light: #d4a843;
    --text: #f0ece2;
    --muted: #a09880;
    --subtle: #c4bed8;
    --border: rgba(201, 168, 76, 0.2);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

.stars {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(201, 168, 76, 0.5);
    border-radius: 50%;
    animation: twinkle var(--dur, 3s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.8; }
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 24px;
    position: relative;
    z-index: 1;
}

.brand {
    text-align: center;
    font-size: 13px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 12px;
}

.brand-dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    background: var(--gold);
    border-radius: 50%;
    vertical-align: middle;
    margin: 0 6px;
}

h1 {
    text-align: center;
    font-size: 32px;
    font-weight: 300;
    color: var(--gold);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.subtitle {
    text-align: center;
    color: var(--muted);
    font-size: 15px;
    margin-bottom: 48px;
}

/* ── Product Cards ─────────────────────────────── */

.products {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 48px;
}

.product-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    /* visible so feature info-boxes can overflow the card edge */
    overflow: visible;
}

.product-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.04) 0%, transparent 60%);
    pointer-events: none;
}

.product-card:hover {
    border-color: rgba(201, 168, 76, 0.4);
    transform: translateY(-2px);
}

.product-card.selected {
    border-color: var(--gold);
    box-shadow: 0 0 24px rgba(201, 168, 76, 0.15);
}

.product-card.dimmed {
    opacity: 0.45;
    transform: scale(0.98);
}

.product-badge {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
    background: rgba(201, 168, 76, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.product-name {
    font-size: 22px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}

.product-price {
    font-size: 28px;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 20px;
}

.product-features {
    list-style: none;
    padding: 0;
    margin-bottom: 24px;
}

.product-features li {
    padding: 6px 0;
    font-size: 14px;
    color: var(--subtle);
    position: relative;
    padding-left: 22px;
}

.product-features li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: var(--gold);
    font-size: 10px;
    top: 8px;
}

.select-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gold);
    background: transparent;
    color: var(--gold);
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}

.select-btn:hover {
    background: rgba(201, 168, 76, 0.1);
}

.product-card.selected .select-btn {
    background: var(--gold);
    color: var(--bg);
}

/* ── Upload Form ───────────────────────────────── */

.form-section {
    max-width: 600px;
    margin: 0 auto;
    display: none;
    animation: fadeIn 0.5s ease;
}

.form-section.visible {
    display: block;
}

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

.form-title {
    text-align: center;
    font-size: 22px;
    color: var(--gold);
    font-weight: 400;
    margin-bottom: 32px;
}

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 24px;
    background: rgba(18, 18, 31, 0.5);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: rgba(201, 168, 76, 0.5);
    background: rgba(201, 168, 76, 0.04);
}

.upload-zone.has-image {
    border-color: var(--gold);
    border-style: solid;
    padding: 24px;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.6;
}

.upload-text {
    color: var(--muted);
    font-size: 15px;
    margin-bottom: 4px;
}

.upload-hint {
    color: rgba(160, 152, 128, 0.6);
    font-size: 12px;
}

.preview-img {
    max-width: 280px;
    max-height: 280px;
    border-radius: 8px;
    display: none;
}

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

.form-label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
    outline: none;
}

.form-input:focus, .form-textarea:focus {
    border-color: rgba(201, 168, 76, 0.6);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.08);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-input::placeholder, .form-textarea::placeholder {
    color: rgba(160, 152, 128, 0.5);
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--gold) 0%, #d4a843 100%);
    border: none;
    border-radius: 8px;
    color: var(--bg);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: opacity 0.2s;
    margin-top: 8px;
}

.submit-btn:hover {
    opacity: 0.9;
}

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

/* ── Loading State ─────────────────────────────── */

.loading-section {
    display: none;
    text-align: center;
    padding: 80px 24px;
}

.loading-section.visible {
    display: block;
}

.loading-ring {
    width: 80px;
    height: 80px;
    border: 2px solid rgba(201, 168, 76, 0.15);
    border-top-color: var(--gold);
    border-radius: 50%;
    margin: 0 auto 32px;
    animation: spin 1.2s linear infinite;
}

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

.loading-pulse {
    width: 12px;
    height: 12px;
    background: var(--gold);
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.4; box-shadow: 0 0 0 0 rgba(201,168,76,0.4); }
    50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 20px 8px rgba(201,168,76,0.15); }
}

.loading-text {
    font-size: 18px;
    color: var(--gold);
    margin-bottom: 8px;
    min-height: 28px;
}

.loading-sub {
    font-size: 14px;
    color: var(--muted);
}

/* ── Error State ───────────────────────────────── */

.error-msg {
    background: rgba(232, 67, 67, 0.1);
    border: 1px solid rgba(232, 67, 67, 0.3);
    border-radius: 8px;
    padding: 14px 18px;
    color: #e88;
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
}

.error-msg.visible {
    display: block;
}

/* ── Responsive ────────────────────────────────── */

@media (max-width: 680px) {
    .products {
        grid-template-columns: 1fr;
    }
    h1 { font-size: 26px; }
    .product-name { font-size: 20px; }
    .product-price { font-size: 24px; }
    .container { padding: 24px 16px; }
}
