/* ── Reset & Base ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #e91e63;
    --primary-light: #fce4ec;
    --primary-dark: #c2185b;
    --bg: #fafafa;
    --bg-white: #ffffff;
    --text: #333333;
    --text-light: #757575;
    --border: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-pill: 100px;
    --primary-soft: #fff0f3;
    --surface: #f8f9fa;
    --accent: #1565c0;
    --accent-dark: #0d47a1;
    --accent-soft: #e3f2fd;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ── */
.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

/* ── Nav Toggle (Mobile Hamburger) ── */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle__bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
    opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.site-nav a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
}

.site-nav a:hover {
    color: var(--primary);
}

.site-nav a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.site-nav a.nav-admin {
    color: var(--accent);
    font-weight: 500;
}

.site-nav a.nav-admin:hover,
.site-nav a.nav-admin.active {
    color: var(--accent-dark);
    border-bottom-color: var(--accent);
}

/* ── Minimal Header (Chat page) ── */
.site-header--minimal .nav-toggle {
    display: none;
}

.site-header--minimal .site-nav {
    display: flex;
    gap: 1rem;
}

@media (max-width: 768px) {
    .site-header--minimal .site-nav {
        position: static;
        flex-direction: row;
        background: none;
        border: none;
        box-shadow: none;
        padding: 0;
    }

    .site-header--minimal .site-nav a {
        border-bottom: none;
        padding: 0.25rem 0;
    }

    .nav-toggle {
        display: flex;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-white);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        padding: 0.75rem 1rem;
        gap: 0;
        z-index: 99;
    }

    .site-nav.open {
        display: flex;
    }

    .site-nav a {
        padding: 0.75rem 0.5rem;
        border-bottom: 1px solid var(--border);
        font-size: 0.95rem;
    }

    .site-nav a:last-child {
        border-bottom: none;
    }

    .site-nav a.active {
        border-bottom: 1px solid var(--border);
        color: var(--primary);
        font-weight: 600;
    }
}

/* ── Main ── */
.site-main {
    flex: 1;
}

/* ── Home ── */
.home-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 1rem;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.feature-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
}

.feature-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* ── Auth Pages (Login / Register / Profile) ── */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 1rem;
}

.auth-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--bg-white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: #d32f2f;
}

.error-text {
    font-size: 0.8rem;
    color: #d32f2f;
}

.form-help {
    font-size: 0.78rem;
    color: var(--text-light);
    line-height: 1.4;
}

/* ── Password Toggle ── */
.input-password-wrap {
    position: relative;
}

.input-password-wrap input {
    padding-right: 2.5rem;
}

.password-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    padding: 0.25rem;
    display: flex;
    align-items: center;
}

.password-toggle:hover {
    color: var(--text);
}

.btn-full {
    width: 100%;
    margin-top: 0.5rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.alert-error {
    background: #fdecea;
    color: #d32f2f;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.back-link {
    display: inline-block;
    font-size: 0.875rem;
    color: var(--text-light);
    text-decoration: none;
    margin-bottom: 1rem;
}

.back-link:hover {
    color: var(--primary);
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-soft);
    transform: translateY(-1px);
}

/* ── Hero Enhancements ── */
.hero__illustration {
    margin-bottom: 1rem;
}

.hero__actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.feature-card__icon {
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: center;
}

/* ── Footer ── */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.25rem 0;
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--text-light);
}

.site-footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-footer__brand {
    font-weight: 600;
    color: var(--primary);
}

/* ── Accessibility ── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
