/* ========================================
   IMC-SEME 2026 - Registration Form Styles
   Berlin, Germany | October 26–31, 2026
   ======================================== */

:root {
    /* Colors - Primary Theme */
    --primary: #1e3c72;
    --primary-dark: #0a2a4a;
    --accent: #3b82f6;
    --accent-light: #93c5fd;
    --text-dark: #2c3e50;
    --text-light: #64748b;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-gray: #f1f5f9;
    --border: #e2e8f0;
    --border-dark: #cbd5e1;
    --background: #ffffff;
    --background-alt: #f8fafc;
    --success: #2ecc71;
    --error: #e74c3c;
    --warning: #f39c12;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 2.5rem;
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-serif: 'Georgia', 'Times New Roman', serif;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    /* Borders */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, #f5f7fa 0%, #eef2f6 100%);
    color: var(--text-dark);
    line-height: 1.5;
    min-height: 100vh;
    padding: var(--space-xl);
}

/* ----- Header (Matching Main Website) ----- */
header {
    background: var(--background);
    padding: var(--space-lg) 0;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border);
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-block {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.logo-top {
    display: flex;
    align-items: baseline;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.logo-accent {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-serif);
    letter-spacing: 1px;
    line-height: 1.2;
}

.logo-date {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--accent);
    font-family: var(--font-sans);
    background: rgba(59, 130, 246, 0.1);
    padding: 3px 15px;
    border-radius: 40px;
    line-height: 1.2;
}

.logo-middle {
    font-size: 0.95rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-weight: 500;
}

.logo-bottom {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.logo-bottom .dot {
    color: var(--accent);
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Responsive Header */
@media (max-width: 768px) {
    .logo-accent {
        font-size: 1.8rem;
    }
    .logo-date {
        font-size: 1.4rem;
        padding: 2px 10px;
    }
    .logo-middle {
        font-size: 0.75rem;
        letter-spacing: 2px;
    }
    .logo-bottom {
        font-size: 0.75rem;
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .logo-top {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
    .logo-accent {
        font-size: 1.5rem;
    }
    .logo-date {
        font-size: 1.2rem;
        padding: 2px 8px;
    }
    .logo-middle {
        font-size: 0.7rem;
        letter-spacing: 1.5px;
    }
    .logo-bottom {
        font-size: 0.7rem;
        gap: 4px;
    }
}

/* Main Form Container */
.container {
    max-width: 1000px;
    margin: var(--space-2xl) auto;
    padding: 0 var(--space-md);
}

.form-wrapper {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}

form {
    padding: var(--space-2xl);
}

/* Form Elements */
fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    background: var(--bg-white);
    transition: all 0.2s ease;
}

fieldset:hover {
    border-color: var(--border-dark);
    box-shadow: var(--shadow-sm);
}

legend {
    padding: 0 var(--space-md);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    width: auto;
    background: var(--bg-white);
    font-family: var(--font-serif);
}

legend small {
    font-size: 0.8rem;
    font-weight: normal;
    color: var(--text-light);
}

.form-row {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 180px;
}

.form-group.full-width {
    flex: 100%;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.required {
    color: var(--error);
    margin-left: 2px;
    font-weight: 700;
}

input, select, textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s;
    background: var(--bg-white);
}

input:hover, select:hover, textarea:hover {
    border-color: var(--border-dark);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

input.error, select.error, textarea.error {
    border-color: var(--error);
    background: rgba(231, 76, 60, 0.02);
}

.error-message {
    color: var(--error);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.hint {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-top: 0.25rem;
    display: block;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* Co-Author & Companion Entry Styling */
.coauthor-entry, .companion-entry {
    background: var(--bg-light);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.coauthor-entry:hover, .companion-entry:hover {
    border-color: var(--accent);
    background: var(--bg-white);
}

.btn-add, .btn-remove {
    background: #e2e8f0;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-add:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
}

.btn-remove {
    background: #fed7d7;
    color: #c53030;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 50%;
    font-size: 1.2rem;
    margin-top: 0.5rem;
    cursor: pointer;
}

.btn-remove:hover {
    background: #feb2b2;
    transform: scale(1.05);
}

/* Companion Count Dropdown */
#companion-count {
    max-width: 200px;
    margin-bottom: var(--space-md);
    cursor: pointer;
}

/* Checkbox */
.checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    cursor: pointer;
}

.checkbox input {
    width: auto;
    margin-top: 0.2rem;
}

.checkbox span {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Info Note */
.info-note {
    background: #eef2ff;
    border-left: 3px solid var(--primary);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-lg);
    font-size: 0.85rem;
    color: var(--text-dark);
    border-radius: var(--radius-sm);
}

/* Captcha */
.captcha {
    display: flex;
    justify-content: center;
    margin: var(--space-lg) 0;
}

/* Submit Button */
.form-actions {
    text-align: center;
    margin-top: var(--space-lg);
}

.btn-submit {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.footer {
    text-align: center;
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-light);
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet */
@media (max-width: 768px) {
    body {
        padding: var(--space-md);
    }
    
    .header-container {
        padding: 0 var(--space-md);
    }
    
    .logo-accent {
        font-size: 1.8rem;
    }
    
    .logo-date {
        font-size: 1.4rem;
        padding: 2px 10px;
    }
    
    .logo-middle {
        font-size: 0.75rem;
        letter-spacing: 2px;
    }
    
    .logo-bottom {
        font-size: 0.75rem;
        gap: 6px;
    }
    
    form {
        padding: var(--space-lg);
    }
    
    fieldset {
        padding: var(--space-md);
    }
    
    .form-row {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .form-group {
        min-width: 100%;
    }
    
    .container {
        padding: 0 var(--space-sm);
        margin: var(--space-lg) auto;
    }
    
    .info-note {
        padding: var(--space-sm) var(--space-md);
    }
}

/* Mobile */
@media (max-width: 480px) {
    .logo-top {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
    
    .logo-accent {
        font-size: 1.5rem;
    }
    
    .logo-date {
        font-size: 1.2rem;
        padding: 2px 8px;
    }
    
    .logo-middle {
        font-size: 0.7rem;
        letter-spacing: 1.5px;
    }
    
    .logo-bottom {
        font-size: 0.7rem;
        gap: 4px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .btn-submit {
        width: 100%;
        padding: 0.8rem;
    }
    
    .coauthor-entry, .companion-entry {
        padding: var(--space-sm);
    }
    
    .btn-add, .btn-remove {
        width: 100%;
        margin-top: var(--space-sm);
    }
    
    .btn-remove {
        width: 36px;
        margin-top: 0;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    header, .captcha, .form-actions, .footer, .btn-add, .btn-remove {
        display: none !important;
    }
    
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        margin: 0;
        padding: 0;
    }
    
    .form-wrapper {
        box-shadow: none;
        border: none;
    }
    
    fieldset {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #ddd;
    }
    
    input, select, textarea {
        border: 1px solid #ccc;
        background: white;
    }
    
    .info-note {
        background: #f5f5f5;
        border-left: 3px solid #666;
    }
}

/* ========================================
   Accessibility
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}