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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

header { text-align: center; padding: 2rem 1rem 1rem; }
header h1 { font-size: 2rem; }
.subtitle { color: #666; margin-top: 0.25rem; }

main { max-width: 1200px; margin: 0 auto; padding: 1rem; }

form {
    max-width: 600px;
    margin: 0 auto 2rem;
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

label { display: block; font-weight: 600; margin: 1rem 0 0.25rem; }

input, textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

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

/* Colour scheme selector */
.scheme-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.scheme-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.scheme-btn:hover { border-color: #93c5fd; }
.scheme-btn.selected { border-color: #2563eb; background: #eff6ff; }

.scheme-swatches {
    display: flex;
    gap: 2px;
}

.scheme-swatches span {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: block;
}

.scheme-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: #666;
}

button[type="submit"] {
    width: 100%;
    margin-top: 1.5rem;
    padding: 1rem;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

button[type="submit"]:hover { background: #1d4ed8; }
button[type="submit"]:disabled { background: #94a3b8; cursor: wait; }

/* Progress bar */
#progress-bar-container {
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

#progress-bar-container.hidden { display: none; }

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.35rem;
}

.progress-track {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #10b981);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

/* Logo grid */
.logo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.logo-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-card.complete:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.logo-card.active { border: 2px solid #2563eb; }

.logo-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.logo-style {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: #666;
    text-transform: capitalize;
}

.download-btn {
    display: block;
    padding: 0.5rem;
    background: #10b981;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.download-btn:hover { background: #059669; }

.logo-card.error { padding: 2rem; }
.error-msg { color: #dc2626; font-size: 0.85rem; }

/* Card placeholder spinners */
.card-spinner-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem;
}

.card-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #cbd5e1;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.card-spinner.generating {
    border-top-color: #2563eb;
    animation-duration: 0.8s;
}

.card-waiting { font-size: 0.8rem; color: #aaa; }
.card-generating { font-size: 0.8rem; color: #2563eb; font-weight: 600; }

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

@media (max-width: 768px) {
    .logo-grid { grid-template-columns: repeat(2, 1fr); }
    .scheme-selector { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
    .logo-grid { grid-template-columns: 1fr; }
    .scheme-selector { grid-template-columns: repeat(2, 1fr); }
}
