/* the gathering 사용자 화면의 모바일 우선 디자인 시스템 */
:root {
    --primary-color: #ff5a67;
    --primary-dark: #e94a57;
    --secondary-color: #111111;
    --bg-color: #ffffff;
    --card-bg: #ffffff;
    --text-main: #111111;
    --text-sub: #666661;
    --text-muted: #999994;
    --border-color: #e7e7e2;
    --error-color: #e5484d;
    --success-color: #16835f;
    --shadow: none;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --container-max: 640px;
}

html {
    background: #efefec;
    font-size: 16px;
}

body {
    background: #efefec;
    color: var(--text-main);
    font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    letter-spacing: 0;
    overflow-wrap: break-word;
}

body *,
body *::before,
body *::after {
    letter-spacing: 0 !important;
}

body > .app-shell {
    max-width: var(--container-max);
    min-height: 100svh;
    padding-bottom: 0;
    background: var(--bg-color);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.025);
}

body.secure-vote-page {
    user-select: none;
    -webkit-user-select: none;
}

body.secure-vote-page img {
    pointer-events: none;
    -webkit-user-drag: none;
}

.thegathering-secure-media {
    position: relative;
}

.thegathering-secure-media::after {
    content: "THE GATHERING";
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.42);
    font-size: clamp(1.6rem, 10vw, 3.4rem);
    font-weight: 900;
    transform: rotate(-22deg);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.28);
    mix-blend-mode: screen;
}

.secure-vote-page .thegathering-secure-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    pointer-events: none;
    opacity: 0.08;
    background-image:
        repeating-linear-gradient(-28deg, transparent 0 72px, rgba(17, 17, 17, 0.45) 72px 74px),
        repeating-linear-gradient(-28deg, transparent 0 150px, rgba(255, 90, 103, 0.55) 150px 152px);
}

.secure-vote-page.secure-vote-hidden .site-main {
    filter: blur(18px);
}

.secure-vote-page .thegathering-secure-shield {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(17, 17, 17, 0.92);
    color: #fff;
    text-align: center;
    font-weight: 900;
    line-height: 1.55;
}

.secure-vote-page.secure-vote-hidden .thegathering-secure-shield {
    display: flex;
}

@media print {
    body.secure-vote-page .app-shell {
        display: none !important;
    }
    body.secure-vote-page::before {
        content: "보안 정책상 투표 화면은 출력할 수 없습니다.";
        display: flex;
        min-height: 100vh;
        align-items: center;
        justify-content: center;
        padding: 40px;
        font-size: 18px;
        font-weight: 900;
        color: #111;
    }
}

body > .app-shell > header {
    height: 64px;
    padding: 0 22px;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.logo {
    height: auto;
    gap: 7px;
    color: #111;
}

.logo-wordmark {
    font-size: 1.18rem;
    font-weight: 900;
    letter-spacing: 0;
}

.logo-mark {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary-color);
}

.header-action {
    padding: 8px 0;
    border-radius: 0;
    color: var(--text-sub);
    font-size: 0.82rem;
    font-weight: 700;
}

.site-main {
    flex: 1;
    padding: 24px 20px 32px;
    background: #fff;
}

.site-main > .container {
    width: auto;
    min-height: 0;
    padding: 0 !important;
    background: transparent;
    display: block;
}

h1,
h2,
h3,
h4,
h5,
p {
    letter-spacing: 0;
    overflow-wrap: break-word;
}

.page-eyebrow {
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-heading {
    color: var(--text-main);
    font-size: clamp(1.7rem, 7vw, 2.15rem);
    font-weight: 850;
    line-height: 1.18;
    overflow-wrap: break-word;
}

.page-copy {
    margin-top: 10px;
    color: var(--text-sub);
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.55;
    overflow-wrap: anywhere;
    word-break: normal;
}

.btn {
    min-height: 52px;
    padding: 0 20px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 800;
    box-shadow: none;
}

.btn-primary,
.btn-primary:active {
    background: #111;
    color: #fff;
    box-shadow: none;
    transform: none;
}

.btn-secondary {
    background: #ecece8;
    color: #111;
}

.btn-outline {
    background: #fff;
    border: 1px solid #d9d9d3;
    color: #111;
}

.card {
    margin-bottom: 16px;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: #fff;
    box-shadow: none;
}

.badge {
    border-radius: 999px;
    font-weight: 750;
}

.badge-primary {
    background: #111;
    color: #fff;
}

.form-group {
    margin-bottom: 22px;
}

.form-label {
    margin-bottom: 8px;
    color: #222;
    font-size: 0.84rem;
    font-weight: 750;
}

.form-control {
    min-height: 54px;
    padding: 0 2px;
    border: 0;
    border-bottom: 1px solid #d8d8d2;
    border-radius: 0;
    background: transparent;
    color: #111;
    font-size: 1rem;
    font-weight: 550;
}

textarea.form-control {
    padding: 14px;
    border: 1px solid #d8d8d2;
    border-radius: 12px;
    background: #fff;
}

.form-control:focus {
    border-color: #111;
    background: transparent;
    box-shadow: none;
}

.form-control::placeholder {
    color: #b4b4af;
}

.section-title {
    margin: 32px 0 16px;
    padding: 0;
    font-size: 1.2rem;
    font-weight: 850;
}

.site-footer {
    padding: 28px 20px calc(28px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border-color);
    background: #fff;
}

.site-footer-name {
    margin-bottom: 8px;
    color: #555550;
    font-size: 0.78rem;
    font-weight: 800;
}

.site-footer-meta {
    color: #999994;
    font-size: 0.72rem;
    line-height: 1.7;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    max-width: var(--container-max);
    height: calc(68px + env(safe-area-inset-bottom));
    padding: 6px 18px env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid var(--border-color);
    box-shadow: none;
    transform: translateX(-50%);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.nav-item {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 56px;
    padding: 4px 0 3px;
    color: #aaa9a4;
    font-size: 0.67rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}

.nav-icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-item.active {
    color: #111;
    font-weight: 850;
    transform: none;
}

.nav-item.active .nav-icon {
    stroke-width: 2.15;
}

.nav-item.active::after {
    display: none;
}

body.has-bottom-nav .site-main {
    padding-bottom: calc(84px + env(safe-area-inset-bottom)) !important;
}

body.has-bottom-nav .member-home,
body.has-bottom-nav .program-list-page,
body.has-bottom-nav .apps-container,
body.has-bottom-nav .profile-page,
body.has-bottom-nav .meeting-detail,
body.has-bottom-nav .intro-wrap,
body.has-bottom-nav .selection-page,
body.has-bottom-nav .attendee-page {
    padding-bottom: 0 !important;
}

.account-link i {
    display: none;
}

.account-link::after {
    width: 7px;
    height: 7px;
    border-top: 1.5px solid #aaa9a4;
    border-right: 1.5px solid #aaa9a4;
    content: "";
    transform: rotate(45deg);
}

.meeting-hero.has-image::after {
    display: none !important;
}

.chat-compose {
    bottom: calc(68px + env(safe-area-inset-bottom)) !important;
    z-index: 900;
    max-width: var(--container-max) !important;
}

.chat-compose .btn {
    flex: 0 0 auto;
    width: auto;
    min-height: 46px;
}

.thegathering-page {
    max-width: var(--container-max);
    margin: 0 auto;
}

.thegathering-page-head {
    margin-bottom: 28px;
}

.thegathering-section {
    padding: 28px 0;
    border-top: 1px solid var(--border-color);
}

.thegathering-section:first-child {
    border-top: 0;
}

.thegathering-section-title,
.thegathering-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    color: #111;
    font-size: 1.06rem;
    font-weight: 850;
    line-height: 1.35;
}

.thegathering-section-copy {
    margin: -8px 0 18px;
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.55;
    overflow-wrap: anywhere;
    word-break: normal;
}

.thegathering-card {
    margin-bottom: 16px;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: #fff;
}

.thegathering-card.flush {
    padding: 0;
    overflow: hidden;
}

.thegathering-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 24px;
    padding: 15px 16px;
    border: 1px solid #f0d7d7;
    border-radius: 12px;
    background: #fff7f7;
    color: #c43236;
    font-size: 0.9rem;
    font-weight: 750;
    line-height: 1.45;
}

.thegathering-alert.success {
    border-color: #cfe7dd;
    background: #f3fbf7;
    color: #16724f;
}

.thegathering-note {
    padding: 14px 15px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #f8f8f5;
    color: #666661;
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.55;
}

.thegathering-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 14px;
    color: var(--text-sub);
    font-size: 0.82rem;
    font-weight: 650;
}

.thegathering-meta > span,
.thegathering-meta > div {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
}

.thegathering-empty {
    padding: 48px 22px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: #fff;
    text-align: center;
}

.thegathering-empty strong {
    display: block;
    margin-bottom: 6px;
    color: #111;
    font-size: 1rem;
    font-weight: 850;
}

.thegathering-empty span,
.thegathering-empty p {
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.5;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.form-actions .btn {
    flex: 1 1 0;
}

.profile-edit-page {
    padding-top: 8px;
}

.profile-photo-panel {
    margin-bottom: 28px;
}

.profile-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.profile-photo-item {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 8px;
}

.profile-photo-slot {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border: 1px solid #deded8;
    border-radius: 14px;
    background: #eeeeea;
}

.profile-photo-slot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-photo-preview[hidden],
.profile-photo-empty-state[hidden] {
    display: none;
}

.profile-photo-slot input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.profile-photo-empty-state {
    display: flex;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #9b9b96;
    font-size: 0.76rem;
    font-weight: 750;
}

.profile-photo-empty-state .fa-plus {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #111;
    color: #fff;
}

.profile-delete-check {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.profile-delete-check input {
    accent-color: #111;
}

.profile-form-card {
    margin-bottom: 20px;
}

.profile-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.profile-form-stack {
    display: grid;
    gap: 18px;
}

.profile-edit-page .radio-group {
    flex-direction: row;
    gap: 10px;
    margin-bottom: 0;
}

.profile-edit-page .radio-item {
    flex: 1 1 0;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.choice-check {
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border: 1px solid #deded8;
    border-radius: 10px;
    background: #fff;
    color: #111;
    font-size: 0.86rem;
    font-weight: 750;
    line-height: 1.35;
    cursor: pointer;
}

.choice-check input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    accent-color: #111;
}

.privacy-consent-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 12px;
    padding: 14px;
    border: 1px solid #deded8;
    border-radius: 12px;
    background: #fff;
    color: #111;
    font-size: 0.9rem;
    font-weight: 750;
    line-height: 1.45;
    cursor: pointer;
}

.privacy-consent-check input {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    accent-color: #111;
}

.fa-solid,
.fa-regular,
.fas,
.far {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    width: 1em;
    height: 1em;
    align-items: center;
    justify-content: center;
    color: currentColor;
    font-style: normal;
    line-height: 1;
    vertical-align: -0.12em;
}

.fa-solid::before,
.fa-regular::before,
.fas::before,
.far::before {
    box-sizing: border-box;
    content: "";
    display: block;
}

.fa-calendar::before,
.fa-calendar-day::before,
.fa-calendar-check::before {
    width: 0.86em;
    height: 0.8em;
    border: 1.7px solid currentColor;
    border-radius: 2px;
    box-shadow: inset 0 0.22em 0 rgba(0, 0, 0, 0.08);
}

.fa-location-dot::before,
.fa-map-location-dot::before {
    width: 0.72em;
    height: 0.72em;
    border: 2px solid currentColor;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
}

.fa-circle-check,
.fa-check-circle,
.fa-circle-exclamation,
.fa-circle-info {
    border: 1.8px solid currentColor;
    border-radius: 50%;
}

.fa-circle-check::before,
.fa-check-circle::before {
    width: 0.48em;
    height: 0.25em;
    border-bottom: 1.8px solid currentColor;
    border-left: 1.8px solid currentColor;
    transform: rotate(-45deg) translate(0.02em, -0.03em);
}

.fa-circle-exclamation::before {
    content: "!";
    font-size: 0.72em;
    font-weight: 900;
}

.fa-exclamation-triangle::before {
    content: "!";
    width: 0.98em;
    height: 0.9em;
    border: 1.8px solid currentColor;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: 900;
    line-height: 0.86em;
    text-align: center;
}

.fa-circle-info::before {
    content: "i";
    font-size: 0.72em;
    font-weight: 900;
}

.fa-plus::before,
.fa-plus::after {
    position: absolute;
    width: 0.66em;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    content: "";
}

.fa-plus::after {
    transform: rotate(90deg);
}

.fa-chevron-right::before,
.fa-chevron-up::before,
.fa-chevron-down::before,
.fa-arrow-left::before,
.fa-arrow-right-from-bracket::before {
    width: 0.54em;
    height: 0.54em;
    border-top: 1.8px solid currentColor;
    border-right: 1.8px solid currentColor;
}

.fa-chevron-right::before {
    transform: rotate(45deg);
}

.fa-chevron-up::before {
    transform: rotate(-45deg);
}

.fa-chevron-down::before {
    transform: rotate(135deg);
}

.fa-arrow-left::before {
    transform: rotate(-135deg);
}

.fa-arrow-right-from-bracket::before {
    transform: rotate(45deg);
}

.fa-heart::before,
.fa-heart-pulse::before {
    content: "♥";
    font-size: 1em;
    font-weight: 900;
}

.fa-user::before,
.fa-user-secret::before,
.fa-users-slash::before {
    width: 0.72em;
    height: 0.72em;
    border: 1.8px solid currentColor;
    border-radius: 50%;
}

.fa-camera::before,
.fa-camera-retro::before {
    width: 0.9em;
    height: 0.66em;
    border: 1.7px solid currentColor;
    border-radius: 3px;
}

.fa-briefcase::before {
    width: 0.9em;
    height: 0.66em;
    border: 1.7px solid currentColor;
    border-radius: 3px;
    box-shadow: inset 0 0.18em 0 rgba(0, 0, 0, 0.08);
}

.fa-house::before {
    width: 0.78em;
    height: 0.78em;
    border-left: 1.8px solid currentColor;
    border-top: 1.8px solid currentColor;
    transform: rotate(45deg) translate(0.08em, 0.08em);
}

.fa-cake-candles::before,
.fa-id-card::before,
.fa-mobile-screen::before,
.fa-user-shield::before,
.fa-user-lock::before,
.fa-user-check::before,
.fa-floppy-disk::before,
.fa-pen::before,
.fa-flag-checkered::before,
.fa-utensils::before {
    width: 0.86em;
    height: 0.86em;
    border: 1.7px solid currentColor;
    border-radius: 3px;
}

.fa-shield-halved::before {
    width: 0.78em;
    height: 0.9em;
    border: 1.8px solid currentColor;
    border-radius: 0.45em 0.45em 0.22em 0.22em;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-actions {
        flex-direction: column;
    }

    .profile-form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .choice-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .site-main {
        padding: 20px;
    }

    body > .app-shell > header {
        height: 60px;
        padding: 0 20px;
    }
}
