/* ===== CSS Variables ===== */
:root {
    --bg: #f5f5f6;
    --bg-warm: #f0f0f1;
    --surface: #ffffff;
    --surface-subtle: #fafafa;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --text-faint: #bbbbbb;
    --border: #e2e2e4;
    --border-subtle: #ebebec;
    --border-hover: #cccccc;
    --accent: #555555;
    --accent-hover: #333333;
    --danger: #cc4444;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --radius: 6px;
    --radius-lg: 10px;
    --transition: all 0.25s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 1.25rem;
    width: 100%;
}

/* ===== Header ===== */
.header {
    background: transparent;
    padding-top: 1.5rem;
}

.header-content {
    display: flex;
    align-items: center;
    height: 48px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.logo-icon {
    width: 22px;
    height: 22px;
    stroke: var(--text-muted);
}

/* ===== Hero Section ===== */
.hero {
    padding: 2rem 0 3rem;
}

.hero-content {
    text-align: left;
}

.hero h1 {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.hero p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.8;
    max-width: 420px;
}

/* ===== Form Section ===== */
.form-section {
    flex: 1;
    padding: 0 0 4rem;
}

.form-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    max-width: 520px;
    margin: 0 auto;
    overflow: hidden;
}

.form-header {
    padding: 1.5rem 1.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.form-header h2 {
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.form-header p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

#complaintForm {
    padding: 1.25rem 1.75rem 1.75rem;
}

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

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--surface);
    transition: var(--transition);
    outline: none;
    -webkit-appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-faint);
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--border-hover);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.03);
}

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

.char-count {
    text-align: right;
    font-size: 0.6875rem;
    color: var(--text-faint);
    margin-top: 0.25rem;
}

/* ===== Type Selector ===== */
.type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
}

.type-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    background: var(--surface);
}

.type-option svg {
    width: 22px;
    height: 22px;
    stroke: var(--text-faint);
    transition: var(--transition);
    stroke-width: 1.5;
}

.type-option span {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.type-option:hover {
    border-color: var(--border-hover);
    background: var(--surface-subtle);
}

.type-option.active {
    border-color: var(--text-muted);
    background: var(--bg-warm);
}

.type-option.active svg {
    stroke: var(--text-secondary);
}

.type-option.active span {
    color: var(--text-secondary);
}

/* ===== Submit Button ===== */
.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 2rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 400;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.25rem;
    letter-spacing: 0.02em;
}

.submit-btn svg {
    width: 16px;
    height: 16px;
}

.submit-btn:hover {
    background: var(--accent-hover);
}

.submit-btn:active {
    transform: scale(0.995);
}

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

/* ===== Footer ===== */
.footer {
    padding: 1.5rem 0;
    text-align: center;
}

.footer p {
    font-size: 0.75rem;
    color: var(--text-faint);
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--surface);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 0.625rem;
    z-index: 1000;
    opacity: 0;
    transition: all 0.35s ease;
    min-width: 260px;
    max-width: 88vw;
    border: 1px solid var(--border-subtle);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    border-color: var(--border);
}

.toast.error {
    border-color: rgba(204,68,68,0.2);
}

.toast-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.toast.success .toast-icon {
    background: var(--text-muted);
    color: #fff;
}

.toast.success .toast-icon::after {
    content: '\2713';
}

.toast.error .toast-icon {
    background: var(--danger);
    color: #fff;
}

.toast.error .toast-icon::after {
    content: '\2715';
}

.toast-message {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ===== Spinner ===== */
.spinner {
    animation: spin 0.8s linear infinite;
}

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

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .header {
        padding-top: 1rem;
    }

    .hero {
        padding: 1.25rem 0 2rem;
    }

    .hero h1 {
        font-size: 1.25rem;
    }

    .hero p {
        font-size: 0.75rem;
    }

    .form-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .form-header,
    #complaintForm {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.875rem;
    }

    .type-option {
        padding: 0.875rem;
    }
}
