/* ============================================
   CLEAN & PREMIUM FORM DESIGN
   Target: Single Purpose Entry Page
   Theme: Minimalist, Trustworthy, Gold Accent
   ============================================ */

:root {
    /* Color Palette */
    --bg-page: #F9F9F9;
    --bg-card: #FFFFFF;

    --text-primary: #1A1A1A;
    --text-secondary: #555555;
    --text-tertiary: #999999;

    --accent-color: #B48E2E;
    /* Luxurious Gold */
    --accent-dark: #8E6F1F;
    --border-color: #E0E0E0;
    --border-focus: #B48E2E;

    --error-color: #E53935;
    --success-color: #43A047;

    /* Spacing & Layout */
    --layout-width: 640px;
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

/* Base Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* Layout Wrapper */
.form-page-wrapper {
    width: 100%;
    max-width: var(--layout-width);
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

/* Header */
.form-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.brand-logo {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent-color);
    border-radius: 100px;
    margin-bottom: 1.5rem;
}

.logo-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-color);
    letter-spacing: 0.05em;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Form Container */
.entry-form {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    /* Static shadow, no hover */
    padding: 2.5rem;
    border: 1px solid var(--border-color);
}

.form-section {
    margin-bottom: 0;
}

.form-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.required {
    color: var(--accent-color);
}

/* Inputs */
.form-input {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #FAFAFA;
    transition: none;
    /* No hover effect */
}

.form-input::placeholder {
    color: #CCCCCC;
}

/* Focus state is essential for accessibility, keeping it minimal */
.form-input:focus {
    outline: none;
    border-color: var(--border-focus);
    background: #FFFFFF;
}

/* Divider */
.form-divider {
    height: 1px;
    background: #EEEEEE;
    margin: 2.5rem 0;
    border: none;
}

/* Radio Group (Modern Cards) */
.radio-group-modern {
    display: flex;
    gap: 1rem;
}

.radio-card {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.radio-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #FAFAFA;
    /* transition removed */
}

.radio-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.radio-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Selected State - Static */
.radio-card input:checked+.radio-content {
    border-color: var(--accent-color);
    background: #FEFDF5;
    /* Very subtle gold tint */
    color: var(--accent-color);
}

.radio-card input:checked+.radio-content .radio-text {
    color: var(--accent-color);
    font-weight: 700;
}

/* File Upload Modern */
.file-upload-modern {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: #FAFAFA;
    padding: 2rem;
    text-align: center;
    position: relative;
    cursor: pointer;
}

.file-upload-modern input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 2rem;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
    display: block;
}

.primary-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.secondary-text {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

/* Analysis Result */
.analysis-result {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #F0F9F0;
    border: 1px solid #C8E6C9;
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.analysis-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.analysis-status-dot {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
}

.analysis-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--success-color);
}

/* Terms Box */
.terms-box {
    background: #F8F8F8;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 2rem;
}

.terms-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.terms-header h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.terms-list {
    list-style: none;
    padding: 0;
}

.terms-list li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    padding-left: 0.8rem;
    position: relative;
    line-height: 1.5;
}

.terms-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

/* Checkboxes */
.agreement-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    position: relative;
}

.checkbox-wrapper input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-box {
    width: 20px;
    height: 20px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: #FFFFFF;
    flex-shrink: 0;
    position: relative;
    margin-top: 2px;
}

.checkbox-wrapper input:checked+.checkbox-box {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.checkbox-wrapper input:checked+.checkbox-box::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #FFF;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.btn-link {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: underline;
    cursor: pointer;
}

/* Submit Button */
.submit-btn-lg {
    width: 100%;
    background: var(--text-primary);
    /* Modern Black Button */
    color: #FFFFFF;
    border: none;
    padding: 1.2rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    /* transition removed */
}

/* Footer */
.form-footer {
    text-align: center;
    margin-top: 3rem;
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

/* Status Cards (Before/After) */
.status-card {
    text-align: center;
    padding: 3rem 2rem;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.status-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.status-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.status-card p {
    color: var(--text-secondary);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-card {
    background: #FFFFFF;
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-tertiary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.privacy-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.privacy-table th,
.privacy-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #EEEEEE;
    text-align: left;
}

.privacy-table th {
    color: var(--text-primary);
    background: #F9F9F9;
    width: 30%;
    font-weight: 600;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

.btn-primary-sm {
    background: var(--text-primary);
    color: #FFF;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

/* Loading */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-box {
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #EEE;
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

@media (max-width: 600px) {
    .form-page-wrapper {
        padding: 1.5rem 1rem;
    }

    .entry-form {
        padding: 1.5rem;
    }

    .radio-group-modern {
        flex-direction: column;
    }

    .page-title {
        font-size: 1.5rem;
    }
}