/* reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root {
    --primary-color: #0076d6;
    --primary-dark: #005bb5;
    --primary-light: #eaf5ff;
    --bg-page: #f4f6f8;
    --card-bg: #ffffff;
    --input-bg: #f7f8fa;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-placeholder: #999999;
    --error-color: #e53e3e;
    --border-color: #e5e7eb;
    --radius-main: 12px;
}

body {
    background-color: #eef2f5;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* App Mobile Container */
.app-container {
    width: 100%;
    max-width: 480px;
    background-color: var(--card-bg);
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header */
.nav-header {
    height: 48px;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
}

.back-btn {
    position: absolute;
    left: 12px;
    background: none;
    border: none;
    font-size: 18px;
    color: #333333;
    padding: 8px 12px;
    cursor: pointer;
}

.nav-title {
    font-size: 17px;
    font-weight: 600;
    color: #222222;
}

/* Top Banner */
.banner-section {
    width: 100%;
}

.responsive-banner {
    width: 100%;
    height: auto;
    display: block;
}

/* Form Container */
.form-container {
    padding: 20px 18px;
}

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

.section-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

/* Service Grid - 3 Columns Layout */
.service-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 8px;
}

@media (max-width: 360px) {
    .service-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.service-card {
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 44px;
    user-select: none;
}

.service-card:hover {
    border-color: #94a3b8;
    background-color: #f1f5f9;
}

.service-card.selected {
    background-color: #e0f2fe;
    border: 1.5px solid var(--primary-color, #0284c7);
}

.service-card input[type="radio"] {
    display: none;
}

.service-radio-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    cursor: pointer;
}

.custom-radio {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1.5px solid #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    transition: all 0.2s ease;
}

.service-card.selected .custom-radio {
    border-color: var(--primary-color, #0284c7);
}

.custom-radio .inner-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--primary-color, #0284c7);
    display: none;
}

.service-card.selected .custom-radio .inner-dot {
    display: block;
}

.service-name {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    line-height: 1.2;
    word-break: break-word;
}

.service-card.selected .service-name {
    color: var(--primary-color, #0284c7);
    font-weight: 700;
}

/* Form Field Styling */
.field-wrapper {
    margin-bottom: 14px;
}

.field-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.input-control {
    width: 100%;
    height: 48px;
    background-color: var(--input-bg);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0 16px;
    font-size: 15px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.input-control::placeholder {
    color: var(--text-placeholder);
}

.input-control:focus {
    border-color: var(--primary-color);
    background-color: #ffffff;
}

/* Custom Select Dropdown Trigger */
.select-control {
    width: 100%;
    height: 48px;
    background-color: var(--input-bg);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.select-control .placeholder-text {
    color: var(--text-placeholder);
    font-size: 15px;
}

.select-control .selected-text {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
}

.select-control .arrow-icon {
    color: #aaaaaa;
    font-size: 14px;
}

/* Red Error Messages */
.error-text {
    color: var(--error-color);
    font-size: 13px;
    font-weight: 500;
    margin-top: 5px;
    display: none;
}

.error-text.visible {
    display: block;
}

.field-error .input-control,
.field-error .select-control,
.field-error .upload-dropzone {
    border-color: var(--error-color) !important;
    background-color: #fff5f5;
}

/* Payment & QR Section */
.payment-section {
    background-color: #fafbfc;
    border-radius: var(--radius-main);
    padding: 16px;
    border: 1px solid #edf2f7;
}

.qr-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.qr-instruction {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.qr-image-wrapper {
    display: inline-block;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #eee;
    border-radius: 8px;
}

.qr-img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    display: block;
}

.qr-memo-box {
    margin-top: 12px;
    background: #f0f7ff;
    border-radius: 6px;
    padding: 10px;
    font-size: 13px;
    color: #2b6cb0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* File Upload Component */
.upload-dropzone {
    background: #ffffff;
    border: 2px dashed #bbee-dd;
    border-color: #cbd5e0;
    border-radius: 10px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.upload-dropzone:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.file-hidden {
    display: none;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.upload-icon {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.upload-main-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.upload-sub-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.upload-preview-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.preview-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-remove-img {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #e53e3e;
    color: white;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Action Buttons */
.action-section {
    margin-top: 10px;
    text-align: center;
}

.btn-submit {
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, #0088cc, #0066b3);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 136, 204, 0.35);
    transition: transform 0.1s, box-shadow 0.2s;
}

.btn-submit:active {
    transform: scale(0.98);
}

.btn-secondary {
    width: 100%;
    height: 48px;
    background-color: #ffffff;
    color: #0076d6;
    border: 1px solid #b3d7ff;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    margin-top: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background-color: #f0f7ff;
}

.terms-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 14px;
    line-height: 1.5;
}

.terms-link {
    color: #0076d6;
    text-decoration: underline;
}

/* Bottom Stacked Marketing Images */
.bottom-gallery {
    width: 100%;
    margin-top: 10px;
}

.gallery-img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    padding: 0;
}

/* Modals & Action Sheet */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

#gender-modal {
    align-items: flex-end;
}

.modal-overlay.hidden {
    display: none !important;
}

.gender-action-sheet {
    width: 100%;
    max-width: 480px;
    background: #e2e4e8;
    animation: slideUp 0.25s ease-out;
}

.gender-sheet-group {
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

.gender-option {
    width: 100%;
    height: 52px;
    background: #ffffff;
    border: none;
    border-bottom: 1px solid #e8e8e8;
    font-size: 17px;
    font-weight: 400;
    color: #1a1a1a;
    text-align: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gender-option:last-child {
    border-bottom: none;
}

.gender-option:active {
    background-color: #f2f2f2;
}

.gender-sheet-cancel {
    margin-top: 8px;
    background: #ffffff;
}

.gender-cancel-btn {
    width: 100%;
    height: 52px;
    background: #ffffff;
    border: none;
    font-size: 17px;
    font-weight: 500;
    color: #1a1a1a;
    text-align: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gender-cancel-btn:active {
    background-color: #f2f2f2;
}

/* Success Card Modal */
.success-card {
    background: #ffffff;
    width: 88%;
    max-width: 360px;
    margin: auto;
    border-radius: 20px;
    padding: 32px 24px 24px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    animation: zoomIn 0.25s ease-out;
}

.success-icon-wrap {
    width: 64px;
    height: 64px;
    background-color: #27a868;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: #ffffff;
    font-size: 32px;
}

.success-title {
    font-size: 21px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
    line-height: 1.3;
}

.success-desc {
    font-size: 14px;
    color: #555555;
    line-height: 1.5;
    margin-bottom: 24px;
    padding: 0 4px;
}

.btn-modal-close {
    width: 100%;
    height: 48px;
    background: #0076e4;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-modal-close:active {
    background: #005bb5;
}

.hidden {
    display: none !important;
}

/* Keyframe Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

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