/* style.css */
/* SurveyCraft AI */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg-gradient);
    transition: background 0.3s ease, color 0.3s ease;
}

button, input, textarea, select { font: inherit; }
button { border: 0; }
a { color: inherit; }

.app-shell {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 24px;
}

.hero {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    padding: 26px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.14);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 50px;
    position: relative;
    z-index: 1;
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand-mark {
    display: grid; place-items: center;
    width: 52px; height: 52px;
    border-radius: 18px;
    color: var(--primary);
    background: white;
    font-weight: 900;
    letter-spacing: -0.03em;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.18);
}

.brand-title { font-size: 1.35rem; font-weight: 850; }
.brand-subtitle { font-size: 0.92rem; opacity: 0.78; }

.theme-selector {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 8px;
    padding: 8px 12px;
    outline: none;
    cursor: pointer;
}
.theme-selector option { color: #000; }

.guide-link, .ghost-button, .secondary-button, .primary-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 44px; padding: 0 18px;
    border-radius: 999px; cursor: pointer; text-decoration: none; font-weight: 750;
    transition: all 0.18s ease;
}

.guide-link {
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.32);
    background: rgba(255, 255, 255, 0.13);
}
.guide-link:hover, .ghost-button:hover, .secondary-button:hover, .primary-button:hover {
    transform: translateY(-1px);
}

.hero-grid {
    display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 24px; align-items: end; position: relative; z-index: 1;
}

.eyebrow, .section-kicker {
    margin: 0 0 10px;
    color: var(--accent-2);
    font-size: 0.78rem; font-weight: 850; letter-spacing: 0.12em; text-transform: uppercase;
}
.hero h1 {
    max-width: 850px; margin: 0;
    font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: 0.95; letter-spacing: -0.065em;
}
.hero-text { margin: 22px 0 0; font-size: 1.1rem; line-height: 1.7; opacity: 0.9;}

.profile-card {
    padding: 24px; border-radius: 24px;
    background: rgba(255, 255, 255, 0.13); border: 1px solid rgba(255, 255, 255, 0.24);
}
.profile-label { color: var(--accent-2); font-size: 0.75rem; font-weight: 850; text-transform: uppercase; }
.profile-name { margin-top: 10px; font-size: 1.35rem; font-weight: 850; }

.main-grid {
    display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 24px; margin-top: 24px;
}

.panel {
    border: 1px solid var(--line); border-radius: 24px; background: var(--card);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.05); padding: 24px;
}

.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.panel-header h2 { margin: 0; font-size: 1.6rem; color: var(--primary); }

.form-group { margin-bottom: 18px; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

label { display: block; margin-bottom: 8px; color: var(--ink); font-weight: 800; }
label span { color: var(--accent); }
small { display: block; margin-top: 7px; color: var(--muted); font-size: 0.84rem; }

input, textarea, select {
    width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: 14px 15px;
    color: var(--ink); background: transparent; outline: none; transition: all 0.2s;
}
textarea { resize: vertical; min-height: 96px; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(23, 71, 157, 0.1); }

.primary-button { color: white; background: var(--primary); min-width: 200px; }
.secondary-button { color: var(--primary); background: transparent; border: 1px solid var(--primary); }
.ghost-button { color: var(--primary); background: transparent; border: 1px solid var(--line); }
button:disabled { cursor: not-allowed; opacity: 0.55; }

.button-spinner {
    display: none; width: 18px; height: 18px; border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.35); border-top-color: white; animation: spin 0.85s linear infinite;
}
.primary-button.is-loading .button-spinner { display: inline-block; }
.large-spinner {
    width: 54px; height: 54px; border-radius: 50%; border: 4px solid var(--line);
    border-top-color: var(--primary); animation: spin 0.85s linear infinite; margin: 0 auto 16px;
}

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

.status-box {
    margin-bottom: 18px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); color: var(--primary);
}
.result { min-height: 560px; max-height: 78vh; overflow: auto; padding: 24px; border-radius: 22px; background: transparent; border: 1px solid var(--line); }

.result h2 { margin: 30px 0 12px; color: var(--primary); font-size: 1.35rem; }
.result table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 0.95rem; }
.result th, .result td { padding: 12px; text-align: left; border-bottom: 1px solid var(--line); }
.result th { background: var(--primary); color: white; }

.empty-state, .loading-state, .error-state { display: grid; place-items: center; text-align: center; }
.empty-icon { font-size: 3rem; margin-bottom: 16px; }

@media (max-width: 760px) {
    .hero-grid, .two-columns, .main-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2.2rem; }
    .result table { display: block; overflow-x: auto; white-space: nowrap; }
}
