/**
 * 정기권 신청 페이지 스타일
 * 모바일/PC 반응형
 */

/* ========================================
   Reset & Base
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
    -webkit-font-smoothing: antialiased;
}

/* ========================================
   Layout
======================================== */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0;
    background-color: #fff;
    min-height: 100vh;
}

/* PC용 넓은 레이아웃 (목록 페이지 등) */
.container.wide {
    max-width: 1200px;
}

/* ========================================
   Top Navigation
======================================== */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

.top-nav .nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.top-nav .nav-logo img {
    height: 24px;
    width: auto;
}

.top-nav .nav-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-nav .nav-menu a {
    font-size: 13px;
    color: #666;
    text-decoration: none;
    padding: 6px 0;
}

.top-nav .nav-menu a:hover {
    color: #5F245C;
}

.top-nav .nav-menu a.active {
    color: #5F245C;
    font-weight: 600;
}

.top-nav .nav-divider {
    width: 1px;
    height: 16px;
    background: #ddd;
    align-self: center;
}

.top-nav .nav-menu a.external::after {
    content: '↗';
    font-size: 10px;
    margin-left: 2px;
    opacity: 0.6;
}

/* App Download Modal */
.app-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.app-modal.show {
    display: flex;
}

.app-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    max-width: 300px;
    width: 90%;
}

.app-modal-content h4 {
    font-size: 16px;
    margin-bottom: 20px;
    color: #333;
}

.app-modal-content .app-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.app-modal-content .app-btn {
    display: block;
    text-decoration: none;
}

.app-modal-content .app-btn img {
    width: 150px;
    height: auto;
}

.app-modal-content .app-close {
    margin-top: 16px;
    padding: 10px;
    font-size: 13px;
    color: #888;
    background: none;
    border: none;
    cursor: pointer;
}

.header {
    background: linear-gradient(135deg, #5F245C 0%, #7B3F78 100%);
    color: #fff;
    padding: 20px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.header .sub-title {
    font-size: 13px;
    opacity: 0.9;
}

.content {
    padding: 20px;
    padding-bottom: 100px;
}

.footer-fixed {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    padding: 16px 20px;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

/* ========================================
   Progress Steps (Compact)
======================================== */
.progress-compact {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background: #fff;
    border-bottom: 1px solid #eee;
    gap: 12px;
}

.progress-compact .step-current {
    font-size: 13px;
    font-weight: 700;
    color: #5F245C;
    white-space: nowrap;
}

.progress-compact .step-current #currentStepNum {
    font-size: 16px;
}

.progress-compact .step-total {
    font-size: 13px;
    font-weight: 500;
    color: #999;
    white-space: nowrap;
}

.progress-track {
    flex: 1;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #5F245C 0%, #7B3F78 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 11.11%;
}

/* ========================================
   Step Sections
======================================== */
.step-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.step-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #5F245C;
}

.step-title .step-num {
    color: #5F245C;
}

/* ========================================
   Agreement Section
======================================== */
.agreement-box {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.agreement-box h4 {
    font-size: 14px;
    font-weight: 600;
    color: #5F245C;
    margin-bottom: 12px;
}

.agreement-box p {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.6;
}

.agreement-box ul {
    padding-left: 18px;
    font-size: 13px;
    color: #666;
}

.agreement-box ul li {
    margin-bottom: 6px;
}

.agreement-check {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.agreement-check:hover {
    border-color: #5F245C;
}

.agreement-check.checked {
    border-color: #5F245C;
    background: #fdf5fd;
}

.agreement-check input[type="checkbox"] {
    display: none;
}

.agreement-check .check-icon {
    width: 24px;
    height: 24px;
    border: 2px solid #ccc;
    border-radius: 4px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.agreement-check.checked .check-icon {
    background: #5F245C;
    border-color: #5F245C;
}

.agreement-check .check-icon::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.agreement-check.checked .check-icon::after {
    opacity: 1;
}

.agreement-check span {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* ========================================
   Map Section
======================================== */
.map-container {
    width: 100%;
    height: 200px;
    background: #e0e0e0;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.map-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.parking-info-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.parking-info-card .info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.parking-info-card .info-row:last-child {
    border-bottom: none;
}

.parking-info-card .info-label {
    font-size: 13px;
    color: #666;
}

.parking-info-card .info-value {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* ========================================
   Form Elements
======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.form-label .required {
    color: #e53935;
    margin-left: 2px;
}

.form-label .optional {
    font-size: 12px;
    color: #999;
    font-weight: 400;
}

.form-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    font-size: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #5F245C;
    box-shadow: 0 0 0 3px rgba(95, 36, 92, 0.1);
}

.form-input::placeholder {
    color: #aaa;
}

.form-input.error {
    border-color: #e53935;
}

.form-input:disabled {
    background: #f5f5f5;
    color: #999;
}

.form-select {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    font-size: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 14px center;
    appearance: none;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: #5F245C;
    box-shadow: 0 0 0 3px rgba(95, 36, 92, 0.1);
}

.form-error {
    font-size: 12px;
    color: #e53935;
    margin-top: 6px;
    display: none;
}

.form-error.show {
    display: block;
}

.form-hint {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
}

/* Input with button */
.input-with-btn {
    display: flex;
    gap: 8px;
}

.input-with-btn .form-input {
    flex: 1;
}

.input-with-btn .btn-input {
    width: 100px;
    flex-shrink: 0;
}

/* ========================================
   Radio & Checkbox Cards
======================================== */
.option-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-card {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-card:hover {
    border-color: #5F245C;
}

.option-card.selected {
    border-color: #5F245C;
    background: #fdf5fd;
}

.option-card input {
    display: none;
}

.option-card .radio-circle {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 50%;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.option-card.selected .radio-circle {
    border-color: #5F245C;
}

.option-card .radio-circle::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #5F245C;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.option-card.selected .radio-circle::after {
    opacity: 1;
}

.option-card .option-content {
    flex: 1;
}

.option-card .option-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.option-card .option-desc {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.option-card .option-price {
    font-size: 16px;
    font-weight: 700;
    color: #5F245C;
}

/* ========================================
   Buttons
======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    width: 100%;
    background: #5F245C;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #4a1c48;
}

.btn-secondary {
    background: #fff;
    color: #5F245C;
    border: 2px solid #5F245C;
}

.btn-secondary:hover:not(:disabled) {
    background: #fdf5fd;
}

.btn-input {
    height: 48px;
    padding: 0 16px;
    font-size: 14px;
    background: #5F245C;
    color: #fff;
    border: none;
    border-radius: 8px;
}

.btn-input:disabled {
    background: #ccc;
}

.btn-group {
    display: flex;
    gap: 10px;
}

.btn-group .btn {
    flex: 1;
}

/* ========================================
   Summary Section
======================================== */
.summary-card {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.summary-card h4 {
    font-size: 13px;
    font-weight: 600;
    color: #5F245C;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 13px;
}

.summary-row .label {
    color: #666;
}

.summary-row .value {
    font-weight: 500;
    color: #333;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    padding: 10px 0 0;
    margin-top: 8px;
    border-top: 2px solid #5F245C;
}

.summary-total .label {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.summary-total .value {
    font-size: 20px;
    font-weight: 700;
    color: #5F245C;
}

/* ========================================
   Timer
======================================== */
.timer {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: #e53935;
    margin-left: 8px;
}

/* ========================================
   Alerts
======================================== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

.alert-warning {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

/* ========================================
   Loading Overlay
======================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #5F245C;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Filter Section (목록 페이지)
======================================== */
.filter-section {
    margin-bottom: 20px;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-tab:hover {
    border-color: #5F245C;
    color: #5F245C;
}

.filter-tab.active {
    background: #5F245C;
    border-color: #5F245C;
    color: #fff;
}

/* ========================================
   Recruitment List (목록 카드)
======================================== */
.recruitment-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.recruitment-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.recruitment-card:hover {
    border-color: #5F245C;
    box-shadow: 0 4px 12px rgba(95, 36, 92, 0.15);
    transform: translateY(-2px);
}

.recruitment-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.recruitment-card.disabled:hover {
    border-color: #e0e0e0;
    box-shadow: none;
    transform: none;
}

.recruitment-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.recruitment-card .status-badge {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
}

.status-open {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-closed, .status-finished {
    background: #f5f5f5;
    color: #999;
}

.status-ready {
    background: #fff3e0;
    color: #e65100;
}

.status-lottery, .status-payment {
    background: #e3f2fd;
    color: #1565c0;
}

.recruitment-card .apply-count {
    font-size: 13px;
    color: #5F245C;
    font-weight: 500;
}

.recruitment-card .card-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 16px;
    line-height: 1.4;
}

.recruitment-card .card-info {
    margin-bottom: 16px;
    flex: 1;
}

.recruitment-card .info-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
}

.recruitment-card .info-label {
    color: #888;
}

.recruitment-card .info-value {
    color: #333;
    font-weight: 500;
}

.recruitment-card .card-footer {
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.recruitment-card .btn-detail {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    background: #5F245C;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.recruitment-card .btn-detail:hover:not(:disabled) {
    background: #4a1c48;
}

.recruitment-card .btn-detail:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Empty & Loading States */
.loading-message, .error-message {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 14px;
}

.error-message {
    color: #e53935;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state p {
    color: #888;
    font-size: 14px;
}

/* ========================================
   Modal (상세 팝업)
======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #5F245C 0%, #7B3F78 100%);
    color: #fff;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.modal-section {
    margin-bottom: 20px;
}

.modal-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #5F245C;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.modal-section ul {
    padding-left: 18px;
    font-size: 13px;
    color: #666;
}

.modal-section ul li {
    margin-bottom: 6px;
}

.modal-section .price-info {
    font-size: 16px;
    font-weight: 700;
    color: #5F245C;
}

.modal-section .notice-list {
    font-size: 12px;
    color: #888;
}

.modal-apply-count {
    text-align: center;
    padding: 16px;
    background: #fdf5fd;
    border-radius: 8px;
    font-size: 14px;
    color: #5F245C;
}

.modal-apply-count strong {
    font-size: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #eee;
}

.modal-footer .btn {
    flex: 1;
}

/* ========================================
   Responsive
======================================== */

/* 모바일 (600px 이하) */
@media (max-width: 600px) {
    .recruitment-list {
        grid-template-columns: 1fr;
    }

    .container.wide {
        max-width: 100%;
    }
}

/* 태블릿/PC (601px 이상) */
@media (min-width: 601px) {
    body {
        background: #f0f0f0;
    }

    .container {
        margin-top: 20px;
        margin-bottom: 20px;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        min-height: calc(100vh - 40px);
    }

    .container.wide {
        margin-top: 0;
        margin-bottom: 0;
        border-radius: 0;
        min-height: 100vh;
    }

    .header {
        border-radius: 12px 12px 0 0;
    }

    .container.wide .header {
        border-radius: 0;
    }

    .footer-fixed {
        border-radius: 0 0 12px 12px;
    }

    .content {
        padding: 30px;
        padding-bottom: 120px;
    }
}

/* 대형 PC (1024px 이상) */
@media (min-width: 1024px) {
    .container.wide .content {
        padding: 30px 60px;
    }

    .recruitment-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========================================
   Footer
======================================== */
.site-footer {
    background: #f8f8f8;
    border-top: 1px solid #e0e0e0;
    padding: 24px 20px;
    font-size: 12px;
    color: #888;
    line-height: 1.8;
}

.site-footer .footer-inner {
    max-width: 600px;
    margin: 0 auto;
}

.container.wide .site-footer .footer-inner {
    max-width: 1200px;
}

.site-footer .company-name {
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.site-footer .footer-info {
    word-break: keep-all;
}

.site-footer .footer-contact {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.site-footer .footer-contact a {
    color: #5F245C;
    text-decoration: none;
}
