/* ================================
   CSS Reset & Base Styles
   ================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --primary-bg: #121e39;
    --white: #ffffff;
    --border-red: #dc2626;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --text-light: #9ca3af;
    --success: #10b981;
    --error: #ef4444;
    --focus-ring: rgba(220, 38, 38, 0.2);

    /* Typography */
    --font-family: 'Montserrat', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    padding: var(--spacing-lg) var(--spacing-sm);
}

/* ================================
   Container
   ================================ */
.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    border: 3px solid var(--border-red);
}

/* ================================
   Header
   ================================ */
.form-header {
    background-color: var(--primary-bg);
    color: var(--white);
    padding: var(--spacing-xl) var(--spacing-lg);
    text-align: center;
}

.form-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    line-height: 1.3;
}

.form-header h2 {
    font-size: 1.25rem;
    font-weight: 500;
    opacity: 0.95;
    letter-spacing: 1px;
}

.header-logo {
    max-width: 600px;
    width: 100%;
    height: auto;
    margin-bottom: var(--spacing-md);
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* ================================
   Introduction
   ================================ */
.introduction {
    padding: var(--spacing-lg);
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    margin: var(--spacing-lg);
}

.introduction p {
    font-size: 0.95rem;
    color: #78350f;
    line-height: 1.7;
}

/* ================================
   Form Sections
   ================================ */
form {
    padding: 0 var(--spacing-lg) var(--spacing-lg);
}

.form-section {
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 2px solid #e5e7eb;
}

.form-section:last-of-type {
    border-bottom: none;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-bg);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 3px solid var(--border-red);
    display: inline-block;
}

/* ================================
   Form Grid
   ================================ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: span 2;
}

/* ================================
   Form Labels & Inputs
   ================================ */
label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--spacing-xs);
}

.required {
    color: var(--border-red);
    font-weight: 700;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.95rem;
    color: var(--text-dark);
    background: var(--white);
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--border-red);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

input[readonly] {
    background-color: #f9fafb;
    cursor: not-allowed;
    color: var(--text-gray);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* ================================
   Radio Buttons & Checkboxes
   ================================ */
.radio-group,
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xs);
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-dark);
}

.radio-label input[type="radio"],
.checkbox-label input[type="checkbox"] {
    margin-right: var(--spacing-xs);
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--border-red);
}

.radio-label span,
.checkbox-label span {
    font-size: 0.95rem;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
}

.checkbox-label:hover {
    border-color: var(--border-red);
    background: #fef2f2;
}

.checkbox-label:has(input:checked) {
    border-color: var(--border-red);
    background: #fef2f2;
}

/* ================================
   File Input
   ================================ */
input[type="file"] {
    padding: 0.5rem;
    border: 2px dashed #d1d5db;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

input[type="file"]:hover {
    border-color: var(--border-red);
    background: #fef2f2;
}

/* ================================
   Helper Text & Error Messages
   ================================ */
.helper-text {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-top: var(--spacing-xs);
    line-height: 1.5;
}

.helper-text a {
    color: var(--border-red);
    text-decoration: none;
    font-weight: 600;
}

.helper-text a:hover {
    text-decoration: underline;
}

.error-message {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: var(--spacing-xs);
    font-weight: 600;
}

.notice-box {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: #78350f;
    line-height: 1.6;
}

/* ================================
   Publication Categories
   ================================ */
.publication-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.category-card {
    position: relative;
    border: 2px solid #d1d5db;
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--white);
}

.category-card:hover {
    border-color: var(--border-red);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.category-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.category-card input[type="radio"]:checked+.category-content {
    color: var(--border-red);
}

.category-card input[type="radio"]:checked~.category-content h4::before {
    content: "✓ ";
    font-weight: bold;
}

.category-card input[type="radio"]:checked {
    &~.category-content {
        border-left: 4px solid var(--border-red);
        padding-left: calc(var(--spacing-md) - 4px);
    }
}

.category-card:has(input:checked) {
    border-color: var(--border-red);
    background: #fef2f2;
    box-shadow: var(--shadow-md);
}

.category-content h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: var(--text-dark);
}

.category-content p {
    font-size: 0.85rem;
    color: var(--text-gray);
    line-height: 1.5;
}

/* ================================
   Registration Fees Tables
   ================================ */
.fees-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

.fees-table {
    background: #f9fafb;
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    border: 2px solid #e5e7eb;
}

.fees-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-bg);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--border-red);
}

.pricing-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--spacing-md);
}

.pricing-table thead {
    background: var(--primary-bg);
    color: var(--white);
}

.pricing-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
}

.pricing-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.9rem;
}

.pricing-table tbody tr:last-child td {
    border-bottom: none;
}

.pricing-table tbody tr:hover {
    background: #f3f4f6;
}

.pricing-table td.tba {
    color: #059669;
    font-weight: 600;
}

.early-bird-notice {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: #1e40af;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.early-bird-notice svg {
    flex-shrink: 0;
    color: #2563eb;
}

/* Combined Pricing Table */
.fees-container-single {
    margin-top: var(--spacing-md);
    overflow-x: auto;
}

.pricing-table-combined {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-md);
}

.pricing-table-combined thead {
    background: var(--primary-bg);
    color: var(--white);
}

.pricing-table-combined th {
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pricing-table-combined th:first-child {
    text-align: left;
}

.pricing-table-combined td {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    font-size: 0.9rem;
}

.pricing-table-combined td:first-child {
    font-weight: 600;
    background: #f9fafb;
}

.pricing-table-combined td:not(:first-child) {
    text-align: center;
}

.pricing-table-combined tbody tr:hover {
    background: #f3f4f6;
}

.pricing-table-combined td.tba {
    color: #059669;
    font-weight: 600;
}

/* ================================
   Co-Author Fields
   ================================ */
.co-author-field {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--spacing-sm);
    align-items: end;
    padding: var(--spacing-md);
    background: #f9fafb;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    border: 1px solid #e5e7eb;
}

.co-author-field .form-group {
    margin: 0;
}

.btn-remove {
    padding: 0.75rem 1rem;
    background: var(--error);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: fit-content;
}

.btn-remove:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ================================
   Buttons
   ================================ */
.btn-primary,
.btn-secondary,
.btn-clear {
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.btn-primary {
    background: var(--border-red);
    color: var(--white);
}

.btn-primary:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--primary-bg);
    color: var(--white);
    margin-top: var(--spacing-sm);
}

.btn-secondary:hover {
    background: #1a2b52;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-clear {
    background: transparent;
    color: var(--text-gray);
    border: 2px solid #d1d5db;
}

.btn-clear:hover {
    background: #f9fafb;
    border-color: var(--text-gray);
    color: var(--text-dark);
}

/* ================================
   Form Actions
   ================================ */
.form-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 2px solid #e5e7eb;
}

/* ================================
   Footer
   ================================ */
.form-footer {
    background: var(--primary-bg);
    color: var(--white);
    text-align: center;
    padding: var(--spacing-md);
    font-size: 0.9rem;
}

.form-footer p {
    margin: 0;
    opacity: 0.9;
}

/* ================================
   Responsive Design
   ================================ */
@media (max-width: 768px) {
    body {
        padding: var(--spacing-sm);
    }

    .header-logo {
        max-width: 100%;
    }

    .form-header h1 {
        font-size: 1.25rem;
    }

    .form-header h2 {
        font-size: 1rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: span 1;
    }

    .publication-categories {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .btn-primary,
    .btn-secondary,
    .btn-clear {
        width: 100%;
    }

    .co-author-field {
        grid-template-columns: 1fr;
    }

    .fees-container {
        grid-template-columns: 1fr;
    }

    .pricing-table {
        font-size: 0.8rem;
    }

    .pricing-table th,
    .pricing-table td {
        padding: 0.5rem;
    }

    .pricing-table-combined {
        font-size: 0.8rem;
    }

    .pricing-table-combined th,
    .pricing-table-combined td {
        padding: 0.5rem 0.3rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .form-header {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    form {
        padding: 0 var(--spacing-sm) var(--spacing-sm);
    }

    .introduction {
        margin: var(--spacing-sm);
        padding: var(--spacing-sm);
    }

    .section-title {
        font-size: 1.25rem;
    }
}

/* ================================
   Animations
   ================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.co-author-field {
    animation: fadeIn 0.3s ease;
}

/* ================================
   Print Styles
   ================================ */
@media print {
    body {
        background: white;
    }

    .container {
        box-shadow: none;
        border: none;
    }

    .form-actions {
        display: none;
    }
}