/* FinteQC Submission Form - Enhanced Styles */

:root {
    --primary-color: #0066cc;
    --primary-dark: #004d99;
    --primary-light: #3385d6;
    --secondary-color: #00a86b;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --border-color: #dee2e6;
    --background-light: #f8f9fa;
    --text-dark: #212529;
    --text-muted: #6c757d;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.075);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.175);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #f5f7fa;
}

.finteqc-submission-container {
    max-width: 900px;
    margin: 32px auto;
    padding: 0 16px;
}

/* Header Styles */
.finteqc-header {
    text-align: center;
    padding: 40px 32px;
    background: linear-gradient(135deg, #c21807 0%, #7f0000 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    box-shadow: var(--shadow-md);
}

.finteqc-header h1 {
    margin: 0 0 6px 0;
    font-size: 20px !important;
    font-weight: 600;
    line-height: 1.3;
}

.finteqc-header .subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 6px 0;
    font-weight: 500;
}

.finteqc-header p {
    margin: 0;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.85);
}

/* Alert System */
.finteqc-alerts {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    font-size: 15.2px;
    background: white;
    border-left: 4px solid;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-icon {
    font-size: 20px;
    font-weight: bold;
}

.alert-success {
    border-left-color: var(--success-color);
    color: var(--success-color);
}

.alert-error {
    border-left-color: var(--error-color);
    color: var(--error-color);
}

.alert-warning {
    border-left-color: var(--warning-color);
    color: var(--warning-color);
}

.alert-info {
    border-left-color: var(--info-color);
    color: var(--info-color);
}

.alert-message {
    color: var(--text-dark);
}

/* Draft Management */
.draft-management {
    background: white;
    border-radius: 0;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    padding: 16px 32px;
}

.draft-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

#last-saved {
    color: var(--text-muted);
    font-size: 14.4px;
}

.btn-draft {
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14.4px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-draft:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.draft-warning {
    margin-top: 16px;
    padding: 16px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.warning-icon {
    font-size: 24px;
}

.btn-load,
.btn-discard {
    padding: 6.4px 14.4px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13.6px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-load {
    background-color: var(--primary-color);
    color: white;
}

.btn-load:hover {
    background-color: var(--primary-dark);
}

.btn-discard {
    background-color: #dc3545;
    color: white;
}

.btn-discard:hover {
    background-color: #c82333;
}

/* Form Styles */
.finteqc-form {
    background: white;
    border-radius: 0 0 12px 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    border-top: none;
}

.form-section {
    padding: 32px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h2 {
    margin: 0 0 20px 0;
    font-size: 22px;
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.25;
}

.section-description {
    color: var(--text-muted);
    font-size: 15.2px;
    margin: -8px 0 24px 0;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 15.2px;
}

.required {
    color: var(--error-color);
    margin-left: 4px;
}

input[type="text"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: var(--transition);
    font-family: inherit;
    background-color: white;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

input[type="text"].error,
input[type="email"].error,
textarea.error,
select.error {
    border-color: var(--error-color);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Grid Layouts */
.author-grid,
.preferences-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

/* Counters */
.character-counter,
.word-counter {
    font-size: 13.6px;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: right;
}

.character-counter span,
.word-counter span {
    font-weight: 600;
}

.character-counter .warning,
.word-counter .warning {
    color: var(--error-color);
}

/* Validation Feedback */
.validation-feedback {
    font-size: 13.6px;
    margin-top: 8px;
}

.validation-feedback.valid {
    color: var(--success-color);
}

.validation-feedback.invalid {
    color: var(--error-color);
}

/* Tooltip */
.tooltip {
    display: inline-block;
    position: relative;
    cursor: help;
    margin-left: 8px;
    color: var(--info-color);
}

.tooltiptext {
    visibility: hidden;
    width: 250px;
    background-color: var(--text-dark);
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 12px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -125px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 13.6px;
    font-weight: normal;
    line-height: 1.4;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Co-Author Styles */
.co-author-item {
    background-color: var(--background-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    transition: var(--transition);
}

.co-author-item:hover {
    box-shadow: var(--shadow-sm);
}

.co-author-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.co-author-title {
    font-weight: 600;
    font-size: 17.6px;
    color: var(--primary-color);
}

.btn-remove-author {
    padding: 6.4px 14.4px;
    background-color: var(--error-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13.6px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-remove-author:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}

.btn-add-author {
    width: 100%;
    padding: 14.4px 24px;
    background-color: var(--secondary-color);
    color: white;
    border: 2px dashed transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-add-author:hover {
    background-color: #009158;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Declarations Section */
.declarations-section {
    background-color: #f8f9fa;
}

.declarations-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Checkbox Styles */
.checkbox-group {
    margin-bottom: 0 !important;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    cursor: pointer;
    padding: 16px;
    background-color: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: var(--transition);
    margin-bottom: 8px;
}

.checkbox-label:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-top: 2px;
    flex-shrink: 0;
}

.checkbox-description {
    color: var(--text-muted);
    font-size: 14.4px;
    margin: 0;
    padding-left: 32px;
    font-weight: normal;
}

/* File Upload */
.file-upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    padding: 48px 32px;
    text-align: center;
    transition: var(--transition);
    background-color: var(--background-light);
    cursor: pointer;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(0, 102, 204, 0.05);
}

.file-upload-area.has-error {
    border-color: var(--error-color);
    background-color: rgba(220, 53, 69, 0.05);
}

.file-error {
    color: var(--error-color);
    font-size: 15.2px;
    margin-top: 12px;
    display: none;
    min-height: 20px;
}

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

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.upload-placeholder h3 {
    margin: 0 0 8px 0;
    color: var(--text-dark);
    font-size: 20px;
}

.upload-placeholder p {
    margin: 8px 0;
    color: var(--text-muted);
}

.file-requirements {
    font-size: 13.6px;
    color: var(--text-muted);
}

.btn-browse {
    margin-top: 16px;
    padding: 12px 32px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-browse:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.file-info {
    padding: 24px;
    background-color: var(--background-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
}

.file-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.file-name {
    font-weight: 600;
    color: var(--text-dark);
    word-break: break-word;
}

.file-size {
    color: var(--text-muted);
    font-size: 14.4px;
}

.btn-remove {
    padding: 8px 16px;
    background-color: var(--error-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14.4px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-remove:hover {
    background-color: #c82333;
}

/* Form Actions */
.form-actions {
    padding: 32px;
    text-align: center;
    background-color: var(--background-light);
    border-radius: 0 0 12px 12px;
}

.btn-submit {
    padding: 16px 48px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 17.6px;
    font-weight: 700;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-submit:active {
    transform: translateY(0);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9998;
}

.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    color: white;
    margin-top: 16px;
    font-size: 17.6px;
}

/* Confirmation Page */
.confirmation-page {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: fadeIn 0.5s ease;
}

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

.confirmation-header {
    background: linear-gradient(135deg, var(--success-color) 0%, #1f8838 100%);
    color: white;
    text-align: center;
    padding: 48px 32px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background-color: white;
    color: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    margin: 0 auto 24px;
    box-shadow: var(--shadow-md);
}

.confirmation-header h1 {
    margin: 0 0 8px 0;
    font-size: 32px;
    font-weight: 700;
}

.confirmation-header p {
    margin: 0;
    font-size: 17.6px;
    opacity: 0.95;
}

.confirmation-details {
    padding: 40px 32px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--text-muted);
    min-width: 150px;
}

.detail-value {
    font-weight: 500;
    color: var(--text-dark);
    text-align: right;
    word-break: break-word;
}

.confirmation-message {
    background-color: var(--background-light);
    padding: 32px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.confirmation-message p {
    margin: 8px 0;
    color: var(--text-muted);
    font-size: 16px;
}

.confirmation-actions {
    padding: 32px;
    text-align: center;
}

.btn-primary {
    padding: 16px 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 17.6px;
    font-weight: 700;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Responsive Design */
@media (max-width: 768px) {
    .finteqc-submission-container {
        margin: 16px auto;
        padding: 0 8px;
    }
    
    .finteqc-header {
        padding: 32px 16px;
    }
    
    .finteqc-header h1 {
        font-size: 22px !important;
    }
    
    .form-section {
        padding: 24px 16px;
    }
    
    .author-grid,
    .preferences-grid {
        grid-template-columns: 1fr;
    }
    
    .finteqc-alerts {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .draft-info {
        flex-direction: column;
        align-items: stretch;
    }
    
    .detail-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .detail-label,
    .detail-value {
        text-align: left;
        min-width: 0;
    }
}

@media print {
    .draft-management,
    .form-actions,
    .btn-remove,
    .btn-remove-author,
    .btn-add-author,
    .finteqc-alerts {
        display: none !important;
    }
}
