/* style.css */
:root {
    --primary-color: #005EA8; /* 자비스 블루 */
    --primary-light: #3381bf;
    --primary-dark: #00447a;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --bg-color: #f4f6f9;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --border-color: #e0e0e0;
    --error-color: #dc3545;
}

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

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color); color: var(--text-main);
    line-height: 1.6; -webkit-font-smoothing: antialiased;
}

#app {
    max-width: 600px; margin: 0 auto; min-height: 100vh;
    background-color: var(--bg-color); display: flex; flex-direction: column;
}

/* Header */
.app-header {
    background-color: var(--card-bg); padding: 20px;
    text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-bottom: 3px solid var(--primary-color);
}
.logo-container {
    margin-bottom: 10px; display: flex; justify-content: center; align-items: center;
}
.logo-img {
    height: 48px; width: auto; max-width: 100%; object-fit: contain;
}
.header-subtitle { font-size: 14px; color: var(--text-muted); font-weight: 500; }

/* Screens */
.screen { display: none; padding: 20px; animation: fadeIn 0.3s ease-in-out; flex: 1; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.screen-title { font-size: 20px; font-weight: 700; color: var(--primary-color); margin-bottom: 20px; text-align: center; }

/* Menu List */
.menu-list { display: flex; flex-direction: column; gap: 15px; margin-top: 30px; }
.menu-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 120px; border-radius: 12px; font-size: 18px; font-weight: 700; gap: 10px; }
.menu-btn .btn-icon { font-size: 36px; }

/* Form Cards */
.form-card { background: var(--card-bg); border-radius: 12px; padding: 20px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 5px; color: var(--primary-dark); }
.card-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 15px; }

/* Form Groups */
.form-group { margin-bottom: 18px; }
.form-group:last-child { margin-bottom: 0; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--text-main); }
.required { color: var(--error-color); margin-left: 2px; }

input[type="text"], input[type="date"] {
    width: 100%; padding: 14px; border: 1px solid var(--border-color); border-radius: 8px;
    font-size: 16px; font-family: inherit; transition: border-color 0.2s; background-color: #fafafa;
}
input[type="text"]:focus, input[type="date"]:focus {
    outline: none; border-color: var(--primary-color); background-color: #fff; box-shadow: 0 0 0 3px rgba(0, 94, 168, 0.1);
}

/* Radio & Checkboxes generic */
.radio-group { display: flex; gap: 15px; flex-wrap: wrap; margin-bottom: 5px; }
.radio-label { display: flex; align-items: center; cursor: pointer; font-size: 14px; gap: 5px; font-weight: 500;}
.radio-label input[type="radio"] { width: 18px; height: 18px; accent-color: var(--primary-color); }

.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checkbox-label { display: flex; align-items: center; font-size: 14px; font-weight: 500; cursor: pointer; padding: 10px; border: 1px solid var(--border-color); border-radius: 8px; background-color: #fff; transition: all 0.2s; }
.checkbox-label:active { background-color: #f0f0f0; }
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; margin-right: 10px; accent-color: var(--primary-color); }

.time-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.time-label { display: flex; justify-content: center; align-items: center; font-size: 12px; font-weight: 500; cursor: pointer; padding: 8px 4px; border: 1px solid var(--border-color); border-radius: 6px; background-color: #fff; text-align: center;}
.time-label input[type="checkbox"] { display: none; }
.time-label.checked { background-color: var(--primary-color); color: white; border-color: var(--primary-color); }

/* Safety Check List */
.safety-check-list { display: flex; flex-direction: column; gap: 10px; }
.safety-check-row { display: flex; justify-content: space-between; align-items: center; padding: 12px; border: 1px solid var(--border-color); border-radius: 8px; background: #fafafa; }
.safety-check-title { font-size: 13px; font-weight: 600; flex: 1; margin-right: 10px; line-height: 1.4; color: #444; }
.safety-check-options { display: flex; gap: 10px; }
.safety-check-options label { margin-bottom: 0; font-size: 13px !important; }

/* Signature Pad */
.canvas-container {
    border: 2px dashed var(--border-color); border-radius: 8px; background-color: #fff;
    overflow: hidden; position: relative; width: 100%; aspect-ratio: 2 / 1; touch-action: none;
}
canvas { width: 100%; height: 100%; cursor: crosshair; }
.signature-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.error-msg { color: var(--error-color); font-size: 13px; margin-top: 5px; font-weight: 500; }

/* Buttons */
button { font-family: inherit; cursor: pointer; border: none; outline: none; transition: opacity 0.2s, transform 0.1s; }
button:active { transform: scale(0.98); }
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-secondary { background-color: var(--secondary-color); color: white; }
.btn-success { background-color: var(--success-color); color: white; }
.btn-large { width: 100%; padding: 16px; border-radius: 8px; font-size: 16px; font-weight: 700; }
.btn-small { padding: 8px 16px; border-radius: 6px; font-size: 13px; font-weight: 500; }
.action-buttons { display: flex; gap: 10px; margin-top: 20px; padding-bottom: 20px; }
.btn-flex { flex: 1; padding: 16px; border-radius: 8px; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; }
.w-100 { width: 100%; }

/* Spinner */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-radius: 50%; border-top-color: #fff; animation: spin 1s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* PDF Templates Table styling */
.pdf-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 6px; }
.pdf-table th, .pdf-table td { border: 1px solid #444; padding: 6px 8px; text-align: left; }
.pdf-table th { background-color: #f4f6f9; color: var(--primary-dark); font-weight: bold; text-align: center; }
.pdf-table.center-all th, .pdf-table.center-all td { text-align: center; }

/* 외부 PDF 전용: A4 1페이지 최적화 압축 스타일 (백지 현상 해결) */
#pdf-container-external .pdf-table { font-size: 10.5px; margin-bottom: 5px; line-height: 1.25; border-collapse: collapse; }
#pdf-container-external .pdf-table th,
#pdf-container-external .pdf-table td { padding: 3px 5px; }
#pdf-container-external h1 { font-size: 18px !important; margin-bottom: 10px !important; }
#pdf-container-external h3 { font-size: 11px !important; margin-top: 6px !important; margin-bottom: 3px !important; }
#pdf-container-external p { margin-top: 2px !important; margin-bottom: 2px !important; line-height: 1.2 !important; }
#pdf-container-external { color: #000; }

/* PDF 생성 안정화 (백지 현상 방지) */
#temp-pdf-wrapper {
    background-color: #fff !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

@media print {
    #app, .loading-overlay { display: none !important; }
    #temp-pdf-wrapper { display: block !important; }
}






