@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
    --background: hsl(216, 20%, 97%);
    --foreground: hsl(210, 30%, 20%);
    --card: hsl(0, 0%, 100%);
    --card-foreground: hsl(210, 30%, 20%);
    --primary: hsl(207, 90%, 48%);
    --primary-foreground: hsl(0, 0%, 100%);
    --secondary: hsl(174, 100%, 29%);
    --secondary-foreground: hsl(0, 0%, 100%);
    --muted: hsl(210, 20%, 96%);
    --muted-foreground: hsl(210, 20%, 45%);
    --accent: hsl(210, 40%, 94%);
    --accent-foreground: hsl(210, 30%, 20%);
    --destructive: hsl(0, 65%, 51%);
    --border: hsl(210, 20%, 85%);
    --input: hsl(210, 20%, 85%);
    --ring: hsl(207, 90%, 48%);
    --radius: 8px;
    --orange: hsl(24, 95%, 53%);
    --orange-hover: hsl(24, 95%, 46%);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--background);
    color: var(--foreground);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    line-height: 1.5;
}

.container {
    max-width: 520px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.container-wide {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: var(--primary);
    border-radius: 50%;
    margin-bottom: 1rem;
}

.header-icon svg {
    width: 32px;
    height: 32px;
    color: var(--primary-foreground);
}

.header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.header p {
    color: var(--muted-foreground);
    font-size: 0.95rem;
}

.card {
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.card-body {
    padding: 2rem;
}

.info-box {
    background: hsla(207, 90%, 48%, 0.05);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid hsla(207, 90%, 48%, 0.2);
    margin-bottom: 1.5rem;
}

.info-box h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.info-box p {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    line-height: 1.6;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--foreground);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--foreground);
    background: var(--card);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px hsla(207, 90%, 48%, 0.1);
}

.form-group input.is-invalid {
    border-color: var(--destructive);
}

.form-group input.is-invalid:focus {
    box-shadow: 0 0 0 3px hsla(0, 65%, 51%, 0.1);
}

.helper-text {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin-top: 0.25rem;
}

.error-text {
    font-size: 0.75rem;
    color: var(--destructive);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.error-text svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.checkbox-group {
    padding: 1rem;
    background: var(--accent);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
    flex-shrink: 0;
    cursor: pointer;
}

.checkbox-row label {
    font-size: 0.875rem;
    line-height: 1.6;
    cursor: pointer;
}

.checkbox-row label strong {
    display: block;
    margin-bottom: 0.25rem;
}

.privacy-box {
    background: var(--accent);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.75rem;
}

.privacy-box svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.privacy-box strong {
    display: block;
    color: var(--accent-foreground);
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.privacy-box p {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    line-height: 1.6;
}

.btn-submit {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--orange);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 2px 8px hsla(24, 95%, 53%, 0.3);
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}

.btn-submit:hover {
    background: var(--orange-hover);
    box-shadow: 0 4px 12px hsla(24, 95%, 53%, 0.4);
    transform: translateY(-1px);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    background: var(--muted);
    color: var(--muted-foreground);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.required-note {
    text-align: center;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin-top: 1rem;
}

.footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.footer p + p {
    margin-top: 0.5rem;
}

/* Success Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--card);
    border-radius: 12px;
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal .success-icon {
    width: 64px;
    height: 64px;
    background: var(--secondary);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.modal .success-icon svg {
    width: 32px;
    height: 32px;
    color: var(--secondary-foreground);
}

.modal h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.modal p {
    color: var(--muted-foreground);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.modal .btn-close {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    color: var(--primary-foreground);
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

.modal .btn-close:hover {
    background: hsl(207, 90%, 42%);
}

/* Submissions Table */
.card-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
}

.card-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.card-header .subtitle {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-top: 0.25rem;
}

.submissions-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: hsl(142, 71%, 35%);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    background: hsla(142, 71%, 35%, 0.08);
    border-radius: var(--radius);
}

.count-badge svg {
    width: 18px;
    height: 18px;
}

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: var(--primary-foreground);
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-export:hover {
    background: hsl(207, 90%, 42%);
    transform: translateY(-1px);
}

.btn-export:active {
    transform: translateY(0);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead tr {
    border-bottom: 2px solid var(--border);
}

th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--muted);
}

tbody tr:hover {
    background: hsla(210, 40%, 94%, 0.5);
}

.consent-yes {
    color: hsl(142, 71%, 35%);
    font-weight: 600;
}

.consent-no {
    color: var(--destructive);
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted-foreground);
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    margin-bottom: 1rem;
}

.nav-link:hover {
    text-decoration: underline;
}

.alert-error {
    background: hsla(0, 65%, 51%, 0.08);
    color: var(--destructive);
    padding: 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.alert-error svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .card-body {
        padding: 1.5rem;
    }

    .card-header {
        padding: 1.25rem 1.5rem;
    }

    th, td {
        padding: 0.5rem 0.625rem;
        font-size: 0.8125rem;
    }
}
