/* Premium UI Styles for Pleiku Tourism Commitment Form */

:root {
    --primary: #b31d1d;          /* Official administrative red */
    --primary-light: #d63636;
    --primary-dark: #801010;
    --primary-rgb: 179, 29, 29;
    
    --secondary: #c5a059;        /* Warm gold accent */
    --secondary-dark: #a17f3d;
    
    --success: #1b8a5a;          /* Pleiku green for safety & approval */
    --success-light: #24b274;
    --success-bg: #e8f5e9;
    
    --dark-txt: #2c3e50;
    --light-txt: #7f8c8d;
    --bg-color: #f7f9fc;
    --card-bg: #ffffff;
    
    --border-color: #e2e8f0;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--dark-txt);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    position: relative;
}

/* Background Glowing Orbs for Modern Premium Aesthetics */
.background-decorations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.12;
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background-color: var(--primary);
}

.orb-2 {
    bottom: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background-color: var(--secondary);
}

/* Main Container */
.container {
    width: 100%;
    max-width: 850px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    animation: slideUp 0.8s ease-out;
}

/* Header Section styling */
.header {
    text-align: center;
    background: linear-gradient(135deg, #ffffff 0%, #fdfcf7 100%);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(197, 160, 89, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 50%, var(--primary) 100%);
}

.national-emblem-placeholder {
    width: 80px;
    height: 80px;
    background-color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(179, 29, 29, 0.3);
    border: 3px solid var(--secondary);
    transition: transform var(--transition-normal);
}

.national-emblem-placeholder:hover {
    transform: rotate(15deg) scale(1.05);
}

.emblem-icon {
    font-size: 2.2rem;
    color: #ffffff;
}

.header-text h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1.5px;
    margin-bottom: 5px;
}

.divider-line {
    width: 80px;
    height: 2px;
    background-color: var(--secondary);
    margin: 10px auto;
}

.header-text h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 10px;
    line-height: 1.3;
}

.header-text h2 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--dark-txt);
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.5;
}

.directive-box {
    background-color: rgba(197, 160, 89, 0.08);
    border-left: 4px solid var(--secondary);
    border-radius: var(--radius-sm);
    padding: 15px 20px;
    text-align: left;
    max-width: 700px;
    margin-top: 10px;
}

.directive-box p {
    font-size: 0.9rem;
    color: #7f642e;
    font-style: italic;
    line-height: 1.5;
}

.directive-box i {
    margin-right: 8px;
}

/* Stepper Navigation styling */
.stepper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--card-bg);
    padding: 20px 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    position: relative;
    z-index: 1;
    transition: all var(--transition-normal);
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #f1f5f9;
    border: 2px solid var(--border-color);
    color: var(--light-txt);
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.step-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--light-txt);
    transition: all var(--transition-normal);
    text-align: center;
}

.step.active .step-number {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(179, 29, 29, 0.15);
}

.step.active .step-label {
    color: var(--primary-dark);
}

.step.completed .step-number {
    background-color: var(--success);
    border-color: var(--success);
    color: #ffffff;
}

.step.completed .step-label {
    color: var(--success);
}

.step-line {
    flex: 1;
    height: 2px;
    background-color: var(--border-color);
    margin: 0 -20px;
    transform: translateY(-13px);
    transition: all var(--transition-normal);
}

.step-line.active {
    background-color: var(--primary-light);
}

/* Card Form Styles */
.card-form {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
}

.form-step {
    display: none;
    padding: 40px;
    animation: fadeIn 0.4s ease-out;
}

.form-step.active {
    display: block;
}

.step-title-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 35px;
    border-bottom: 2px solid #f8fafc;
    padding-bottom: 15px;
}

.step-icon {
    width: 44px;
    height: 44px;
    background-color: rgba(179, 29, 29, 0.08);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.step-title-wrapper h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-dark);
}

/* Floating Input Group Fields */
.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px 20px;
    margin-bottom: 15px;
}

.input-group {
    position: relative;
    display: flex;
    flex-direction: column;
}

.input-group.full-width {
    grid-column: span 2;
}

.input-group input, 
.input-group select {
    width: 100%;
    padding: 16px 16px 16px 45px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #fafbfc;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--dark-txt);
    outline: none;
    transition: all var(--transition-fast);
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--primary-light);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(179, 29, 29, 0.08);
}

.input-group label {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--light-txt);
    font-size: 0.95rem;
    pointer-events: none;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Focus and value transitions for inputs */
.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label {
    top: 0;
    left: 12px;
    transform: translateY(-50%) scale(0.85);
    background-color: #ffffff;
    padding: 0 8px;
    color: var(--primary);
    font-weight: 600;
}

/* Custom Select Dropdown Styling */
.input-group select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

/* Arrow indicator for custom select */
.input-group::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--light-txt);
    pointer-events: none;
    transition: all var(--transition-fast);
}

.input-group:focus-within::after {
    color: var(--primary);
    transform: translateY(-50%) rotate(180deg);
}

/* When select is focused or has a value selected */
.input-group select:focus ~ .select-label,
.input-group select:valid ~ .select-label {
    top: 0;
    left: 12px;
    transform: translateY(-50%) scale(0.85);
    background-color: #ffffff;
    padding: 0 8px;
    color: var(--primary);
    font-weight: 600;
}

/* Input group error styling */
.input-group.invalid input,
.input-group.invalid select {
    border-color: #e74c3c;
    background-color: #fffaf9;
}

.input-group.invalid label {
    color: #e74c3c;
}

.error-msg {
    display: none;
    font-size: 0.8rem;
    color: #e74c3c;
    margin-top: 5px;
    margin-left: 5px;
    font-weight: 500;
}

.input-group.invalid .error-msg {
    display: block;
}

/* Step 2: Commitment CSS */
.commitment-section {
    margin-bottom: 35px;
}

.section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.text-red {
    color: var(--primary);
}

.text-green {
    color: var(--success);
}

.section-desc {
    font-size: 0.95rem;
    color: var(--light-txt);
    margin-bottom: 20px;
}

/* Checkbox Cards styling */
.checkbox-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.checkbox-card {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 20px;
    background-color: #fafbfc;
    border: 2.5px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
}

.checkbox-card:hover {
    border-color: rgba(179, 29, 29, 0.4);
    background-color: #fff9f9;
}

.checkbox-card.card-green:hover {
    border-color: rgba(27, 138, 90, 0.4);
    background-color: #f6fbf8;
}

.checkbox-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-custom {
    position: relative;
    height: 24px;
    width: 24px;
    min-width: 24px;
    background-color: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    margin-top: 2px;
    transition: all var(--transition-fast);
}

.checkbox-card input[type="checkbox"]:checked ~ .checkbox-custom {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkbox-card.card-green input[type="checkbox"]:checked ~ .checkbox-custom {
    background-color: var(--success);
    border-color: var(--success);
}

.checkbox-custom::after {
    content: "";
    position: absolute;
    display: none;
    left: 7.5px;
    top: 3.5px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.checkbox-card input[type="checkbox"]:checked ~ .checkbox-custom::after {
    display: block;
}

.checkbox-card input[type="checkbox"]:checked {
    /* checked parent styling trigger */
}

/* Styling for selected card state via JS classes */
.checkbox-card.checked {
    background-color: rgba(179, 29, 29, 0.04);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(179, 29, 29, 0.05);
}

.checkbox-card.card-green.checked {
    background-color: rgba(27, 138, 90, 0.04);
    border-color: var(--success);
    box-shadow: 0 4px 12px rgba(27, 138, 90, 0.05);
}

.checkbox-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.checkbox-label strong {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark-txt);
}

.checkbox-label span {
    font-size: 0.88rem;
    color: var(--light-txt);
}

.checklist-error {
    text-align: center;
    margin-top: 12px;
    display: none;
}

/* Accordion for detailed regulations */
.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: 35px;
    background-color: #fafbfc;
}

.accordion-header {
    width: 100%;
    padding: 18px 24px;
    background-color: #ffffff;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark-txt);
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
    text-align: left;
}

.accordion-header:hover {
    background-color: #fdfbf7;
    color: var(--primary);
}

.accordion-header span i {
    margin-right: 10px;
    color: var(--secondary);
}

.accordion-arrow {
    transition: transform var(--transition-normal);
    color: var(--light-txt);
}

.accordion-item.open .accordion-arrow {
    transform: rotate(180deg);
    color: var(--primary);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal) ease-out;
    border-top: 0px solid var(--border-color);
}

.accordion-item.open .accordion-content {
    border-top: 1px solid var(--border-color);
}

.rules-document {
    padding: 25px 30px;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 350px;
    overflow-y: auto;
}

.rule-block h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
    border-left: 3px solid var(--secondary);
    padding-left: 10px;
}

.rule-block p {
    font-size: 0.88rem;
    color: #576574;
    margin-bottom: 6px;
    padding-left: 15px;
}

/* Step 3: Signature CSS styling */
.confirm-declaration-box {
    background-color: #fffaf0;
    border: 1px dashed var(--secondary);
    border-radius: var(--radius-md);
    padding: 25px;
    margin-bottom: 35px;
}

.confirm-declaration-box p {
    font-size: 0.92rem;
    color: #8a6d3b;
    line-height: 1.7;
    text-align: justify;
}

.signature-section-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 30px;
    margin-bottom: 35px;
}

.signature-pad-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pad-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--dark-txt);
}

.signature-pad-body {
    background-color: #fafbfc;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    height: 180px;
    position: relative;
    cursor: crosshair;
    touch-action: none; /* Prevents scrolling when signing on mobile */
    overflow: hidden;
    transition: all var(--transition-fast);
}

.signature-pad-body:focus-within,
.signature-pad-body:hover {
    border-color: var(--secondary);
}

#signature-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.signature-pad-footer {
    display: flex;
    justify-content: flex-end;
}

.btn-clear-sig {
    background: none;
    border: none;
    color: var(--light-txt);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color var(--transition-fast);
}

.btn-clear-sig:hover {
    color: var(--primary);
}

.signee-name-wrapper {
    display: flex;
    flex-direction: column;
    gap: 25px;
    justify-content: center;
}

.agree-checkbox-card {
    padding: 15px 20px;
    align-items: center;
}

/* Form Submit Status styling */
.form-submit-status {
    display: none; /* JS will set to flex */
    align-items: center;
    justify-content: center;
    gap: 15px;
    background-color: #f8fafc;
    padding: 15px 25px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 25px;
    animation: fadeIn var(--transition-normal);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(179, 29, 29, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

#submit-status-text {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--primary-dark);
}

/* Navigational Buttons */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid #f8fafc;
    padding-top: 25px;
}

.btn {
    padding: 14px 28px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-next {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(179, 29, 29, 0.2);
}

.btn-next:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(179, 29, 29, 0.3);
}

.btn-submit {
    background-color: var(--success);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(27, 138, 90, 0.2);
}

.btn-submit:hover {
    background-color: var(--success-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(27, 138, 90, 0.3);
}

.btn-prev {
    background-color: #f1f5f9;
    color: var(--dark-txt);
    border: 1px solid var(--border-color);
}

.btn-prev:hover {
    background-color: #e2e8f0;
    color: var(--primary-dark);
}

/* Specific Style for PDF Download Button in Success Modal */
.btn-pdf {
    background-color: #34495e;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(52, 73, 94, 0.2);
}

.btn-pdf:hover {
    background-color: #2c3e50;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(52, 73, 94, 0.3);
}

.btn:disabled, .btn-submit:disabled {
    background-color: var(--border-color);
    color: var(--light-txt);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* System Footer styling */
.system-footer {
    text-align: center;
    padding-top: 10px;
}

.system-footer p {
    font-size: 0.8rem;
    color: var(--light-txt);
    line-height: 1.6;
}

.system-footer p:first-child {
    font-weight: 600;
    color: #94a3b8;
}

/* MODAL SYSTEM (SUCCESS POPUP) */
.modal {
    display: none; /* Pop up triggered by JS */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.4s ease-out;
}

.modal-content {
    background-color: var(--card-bg);
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
    padding: 30px 30px 10px 30px;
    display: flex;
    justify-content: center;
}

.success-icon-wrapper {
    width: 72px;
    height: 72px;
    background-color: var(--success-bg);
    color: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    box-shadow: 0 0 0 8px rgba(27, 138, 90, 0.05);
    animation: scaleCheck 0.5s 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.modal-body {
    padding: 10px 30px 30px 30px;
    text-align: center;
}

.modal-body h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--success);
    margin-bottom: 10px;
}

.modal-subtitle {
    font-size: 0.92rem;
    color: var(--light-txt);
    margin-bottom: 25px;
}

.receipt-box {
    background-color: #fafbfc;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    margin-bottom: 20px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 8px;
}

.receipt-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.receipt-row span {
    color: var(--light-txt);
}

.receipt-row strong {
    color: var(--dark-txt);
    font-weight: 700;
}

.receipt-note {
    font-size: 0.78rem;
    color: var(--secondary-dark);
    font-style: italic;
    background-color: rgba(197, 160, 89, 0.05);
    border: 1px solid rgba(197, 160, 89, 0.1);
    border-radius: var(--radius-sm);
    padding: 10px 15px;
    display: flex;
    gap: 8px;
    align-items: center;
    text-align: left;
}

.receipt-note i {
    font-size: 1rem;
}

.modal-footer {
    padding: 20px 30px 30px 30px;
    display: flex;
    justify-content: center;
}

.btn-success-close {
    background-color: var(--success);
    color: #ffffff;
    border: none;
    padding: 12px 35px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(27, 138, 90, 0.2);
    transition: all var(--transition-normal);
}

.btn-success-close:hover {
    background-color: var(--success-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(27, 138, 90, 0.3);
}

/* OFF-SCREEN RENDER CONTAINER FOR PRINTING (A4 SIZE AND FONTS) */
#pdf-document-wrapper {
    position: fixed;
    top: 0;
    left: 100vw;
    width: 794px; /* standard A4 width at 96 DPI */
    background-color: #ffffff;
    box-shadow: none;
    z-index: -9999;
    overflow: hidden;
}

#pdf-document {
    width: 794px;
    color: #000000;
    font-family: 'Times New Roman', Times, serif;
    line-height: 1.5;
    background-color: #ffffff;
    font-size: 14.5px;
}

.pdf-page {
    width: 794px;
    height: 1123px; /* Exact A4 height at 96 DPI */
    padding: 55px 75px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    position: relative;
    overflow: hidden;
}

.pdf-page-2 {
    /* Styles for page 2 to align correctly with print margins */
    padding-top: 55px;
}

.pdf-header {
    text-align: center;
    margin-bottom: 20px;
}

.pdf-national-agency {
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 0.5px;
    display: inline-block;
}

.pdf-header-divider {
    width: 150px;
    height: 1.5px;
    background-color: #000000;
    margin: 5px auto 0 auto;
}

.pdf-title-container {
    text-align: center;
    margin-bottom: 25px;
}

.pdf-main-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    letter-spacing: 1px;
}

.pdf-sub-title {
    font-size: 14.5px;
    font-weight: bold;
    margin: 5px 0 0 0;
    max-width: 580px;
    display: inline-block;
    line-height: 1.3;
}

.pdf-indent-text {
    text-indent: 30px;
    margin-bottom: 12px;
}

.pdf-justify-text {
    text-align: justify;
}

.pdf-italic-text {
    font-style: italic;
}

.pdf-bold-text {
    font-weight: bold;
}

.pdf-info-fields {
    margin-top: 15px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pdf-info-fields p {
    margin: 0;
    border-bottom: 1px dotted #888888;
    padding-bottom: 2px;
}

.pdf-info-fields p strong {
    font-weight: bold;
}

.pdf-article {
    margin-bottom: 14px;
    text-align: justify;
}

.pdf-article h3 {
    font-size: 14px;
    font-weight: bold;
    margin: 0 0 5px 0;
}

.pdf-article p {
    margin: 0 0 4px 0;
    padding-left: 20px;
}

.pdf-checkbox-checked {
    margin: 0 0 4px 0 !important;
    padding-left: 30px !important;
    font-weight: 500;
}

.pdf-signature-section {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end;
}

.pdf-signature-block {
    width: 250px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pdf-sig-title {
    font-weight: bold;
    font-size: 13.5px;
}

.pdf-sig-img-container {
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
}

#pdf-signature-img {
    max-height: 80px;
    max-width: 200px;
}

.pdf-sig-name {
    font-weight: bold;
    font-size: 14px;
}

/* ANIMATIONS DEFINITIONS */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes scaleCheck {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* RESPONSIVE DESIGN FOR SMALL SCREEN DEVICES (MOBILE/TABLET) */
@media (max-width: 768px) {
    .container {
        padding: 20px 10px;
        gap: 20px;
    }
    
    .header {
        padding: 30px 15px;
    }
    
    .header-text h1 {
        font-size: 1.45rem;
    }
    
    .header-text h2 {
        font-size: 0.95rem;
    }
    
    .stepper {
        padding: 15px 15px;
    }
    
    .step-label {
        font-size: 0.75rem;
    }
    
    .form-step {
        padding: 25px 15px;
    }
    
    .input-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .input-group.full-width {
        grid-column: span 1;
    }
    
    .signature-section-wrapper {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .signature-pad-body {
        height: 150px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .modal-footer {
        flex-direction: column-reverse;
        width: 100%;
        gap: 10px;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* TAB NAVIGATION SYSTEM (iOS-like Segmented Control) */
.tab-navigation {
    display: flex;
    background-color: #f1f5f9;
    padding: 5px;
    border-radius: var(--radius-md);
    gap: 4px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 30px auto;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    animation: slideUp 0.6s ease-out;
}

.tab-btn {
    flex: 1;
    justify-content: center;
    padding: 10px 16px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--light-txt);
    background: none;
    border: none;
    border-radius: calc(var(--radius-md) - 4px);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-normal);
    box-shadow: none;
}

.tab-btn:hover {
    color: var(--primary);
    background-color: rgba(255, 255, 255, 0.4);
}

.tab-btn.active {
    color: var(--primary);
    background-color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Watermark for signature pad */
.signature-pad-body::before {
    content: 'Ký tên tại đây';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #e2e8f0;
    font-size: 1.25rem;
    font-weight: 700;
    pointer-events: none;
    letter-spacing: 3px;
    text-transform: uppercase;
    transition: opacity var(--transition-fast);
}

.signature-pad-body.signed::before {
    opacity: 0;
}

/* SEARCH AREA DESIGN */
.search-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    padding: 40px;
    animation: fadeIn 0.4s ease-out;
}

.search-desc {
    color: var(--light-txt);
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.search-form-group {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
    align-items: center;
    margin-bottom: 25px;
}

.btn-search {
    background-color: var(--primary);
    color: #ffffff;
    padding: 16px 30px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(179, 29, 29, 0.2);
    transition: all var(--transition-normal);
}

.btn-search:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(179, 29, 29, 0.3);
}

.search-status {
    display: none; /* Controlled by JS */
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 15px;
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.92rem;
}

/* SEARCH RESULTS LAYOUT */
.search-results {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-item {
    background-color: #fafbfc;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    text-align: left;
}

.result-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background-color: var(--primary);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 12px;
}

.result-title h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark-txt);
    margin-bottom: 4px;
    text-align: left;
}

.result-title span {
    font-size: 0.8rem;
    color: var(--light-txt);
    background-color: #f1f5f9;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 500;
}

.result-date {
    font-size: 0.82rem;
    color: var(--secondary-dark);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.result-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
    font-size: 0.9rem;
}

.result-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.result-row label {
    font-size: 0.78rem;
    color: var(--light-txt);
    font-weight: 500;
}

.result-row span {
    color: var(--dark-txt);
    font-weight: 600;
}

.result-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 5px;
}

.btn-result-download {
    background-color: var(--success);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(27, 138, 90, 0.15);
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-result-download:hover {
    background-color: var(--success-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(27, 138, 90, 0.25);
}

.no-result-box {
    text-align: center;
    padding: 40px 20px;
    background-color: #fafbfc;
    border: 1.5px dashed var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.no-result-icon {
    width: 60px;
    height: 60px;
    background-color: #fff1f2;
    color: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.no-result-box p {
    font-size: 0.95rem;
    color: var(--light-txt);
    max-width: 340px;
    line-height: 1.5;
}

/* UNIFIED RESPONSIVE DESIGN FOR TABLETS AND MOBILE PHONES */
@media (max-width: 768px) {
    .container {
        padding: 15px 10px;
        gap: 15px;
    }
    
    .header {
        padding: 25px 15px;
    }
    
    .header-text h3 {
        font-size: 0.8rem;
    }
    
    .header-text h1 {
        font-size: 1.35rem;
        margin: 6px 0;
    }
    
    .header-text h2 {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .directive-box {
        padding: 10px 12px;
        font-size: 0.78rem;
    }
    
    .stepper {
        padding: 12px 10px;
    }
    
    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .step-label {
        font-size: 0.72rem;
    }
    
    .form-step {
        padding: 20px 15px;
    }
    
    .step-title-wrapper h2 {
        font-size: 1.05rem;
    }
    
    .input-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    
    .input-group.full-width {
        grid-column: span 1;
    }
    
    /* Stepper text layout compacting for mobile */
    @media (max-width: 500px) {
        .step-label {
            display: none; /* Hide labels, show numbers only to prevent overflow */
        }
        .stepper {
            justify-content: center;
            gap: 10px;
            padding: 12px 0;
        }
        .step {
            flex-direction: column;
            gap: 0;
        }
        .step-line {
            width: 40px;
            margin: 0 5px;
        }
    }
    
    .checkbox-cards {
        gap: 10px;
    }
    
    .checkbox-card {
        padding: 12px 15px;
        gap: 12px;
    }
    
    .checkbox-label strong {
        font-size: 0.88rem;
    }
    
    .checkbox-label span {
        font-size: 0.76rem;
    }
    
    .signature-section-wrapper {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .signature-pad-body {
        height: 160px;
    }
    
    .signature-pad-body::before {
        font-size: 1rem;
    }
    
    .form-navigation {
        display: flex;
        gap: 15px;
        width: 100%;
        padding-top: 20px;
    }
    
    .form-navigation .btn {
        flex: 1;
        justify-content: center;
        padding: 12px 15px;
        font-size: 0.88rem;
    }
    
    .modal-content {
        max-width: 100%;
        padding: 15px;
    }
    
    .modal-body {
        padding: 10px 15px 20px 15px;
    }
    
    .modal-footer {
        padding: 15px;
        flex-direction: column-reverse;
        width: 100%;
        gap: 10px;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Search Results mobile adjustment */
    .search-card {
        padding: 25px 15px;
    }
    
    .search-form-group {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .btn-search {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }
    
    .result-body {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .result-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .result-date {
        align-self: flex-end;
    }
}
