/* ==========================================================================
   ACADEMIC FORMS - MASTER STYLESHEET (FIGMA PIXEL-PERFECT)
   Brand Color: #ba141d | Typography: Cairo
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --academic-primary: #ba141d;
    --academic-primary-hover: #961017;
    --academic-primary-dark: #7a0c12;
    --academic-primary-light: #fef2f2;
    --academic-primary-border: rgba(186, 20, 29, 0.2);
    --academic-dark: #1e293b;
    --academic-dark-gray: #334155;
    --academic-muted: #64748b;
    --academic-border: #e2e8f0;
    --academic-border-input: #cbd5e1;
    --academic-bg-page: #f1f5f9;
    --academic-card-bg: #ffffff;
    --academic-radius: 14px;
    --academic-radius-sm: 8px;
    --academic-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
}

/* Base resets */
.academic-form-wrapper,
.academic-form-wrapper * {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    box-sizing: border-box;
}

.academic-form-wrapper {
    width: 100%;
    max-width: 1080px;
    margin: 25px auto;
    background-color: #ffffff;
    border-radius: 18px;
    padding: 35px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    color: #1e293b;
    position: relative;
    overflow: hidden;
}

/* Header Bar: In RTL, Logo on the LEFT, Slogan on the RIGHT */
.academic-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 28px;
    gap: 20px;
}

[dir="rtl"] .academic-header-bar {
    flex-direction: row-reverse;
}
[dir="ltr"] .academic-header-bar {
    flex-direction: row;
}

.header-logo-area {
    display: flex;
    align-items: center;
}
.academic-header-logo {
    max-height: 58px;
    width: auto;
    display: block;
    object-fit: contain;
    mix-blend-mode: multiply;
}
.academic-header-logo.research-logo {
    max-height: 68px;
}
.research-top-banner-img {
    max-height: 68px;
    width: auto;
    display: block;
    border-radius: 6px;
    object-fit: cover;
}

.header-slogan-area {
    text-align: right;
}
[dir="ltr"] .header-slogan-area {
    text-align: left;
}
.slogan-text {
    font-size: 16px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
    line-height: 1.4;
}
.slogan-line {
    width: 48px;
    height: 3.5px;
    background-color: var(--academic-primary);
    border-radius: 2px;
    display: inline-block;
}

/* Two-column Container: In RTL, Sidebar on the LEFT, Form on the RIGHT */
.academic-layout-container {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

[dir="rtl"] .academic-layout-container {
    flex-direction: row-reverse;
}
[dir="ltr"] .academic-layout-container {
    flex-direction: row;
}

/* Sidebar (Left side in Figma) */
.academic-sidebar {
    width: 255px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

/* Workshop Sidebar */
.workshop-sidebar {
    gap: 0;
}
.sidebar-top-title-card {
    background: #ffffff;
    padding: 10px 10px 18px 10px;
    text-align: right;
}
[dir="ltr"] .sidebar-top-title-card {
    text-align: left;
}
.sidebar-title-text {
    font-size: 21px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.35;
    margin: 0;
}
.sidebar-title-text .red-highlight {
    color: var(--academic-primary);
}

.sidebar-photo-container {
    width: 100%;
    margin: 0;
    overflow: hidden;
}
.sidebar-real-photo {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.sidebar-features-polygon {
    background: var(--academic-primary);
    color: #ffffff;
    padding: 24px 18px 38px 18px;
    position: relative;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 24px), 0 100%);
}
.features-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
}
.feature-icon {
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ffffff;
}
.feature-text {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
}

.sidebar-quote-box {
    background: #ffffff;
    border-radius: var(--academic-radius-sm);
    padding: 16px 14px;
    text-align: center;
    border: 1px solid #edf2f7;
    box-shadow: var(--academic-shadow);
    margin-top: -12px;
    position: relative;
    z-index: 2;
}
.quote-symbol {
    font-size: 24px;
    color: var(--academic-primary);
    display: inline-block;
    line-height: 1;
    margin-inline-end: 4px;
}
.quote-text {
    display: inline;
    font-size: 15px;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

/* Research Sidebar */
.research-sidebar {
    gap: 0;
    border-radius: var(--academic-radius);
    overflow: hidden;
    box-shadow: var(--academic-shadow);
    border: 1px solid #e2e8f0;
}
.sidebar-top-globe {
    width: 100%;
}
.sidebar-real-globe {
    width: 100%;
    height: auto;
    display: block;
}

.sidebar-red-block {
    background: var(--academic-primary);
    color: #ffffff;
    padding: 20px 18px;
}
.sidebar-block-title {
    font-size: 15.5px;
    font-weight: 800;
    margin: 0 0 14px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}
.sidebar-goals-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 13px;
}
.sidebar-goals-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}
.goal-icon {
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-dark-block {
    background: #334155;
    color: #ffffff;
    padding: 20px 18px;
}
.guidelines-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 11px;
}
.guidelines-list li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 12.5px;
    line-height: 1.35;
    color: #f1f5f9;
}
.check-circle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid #ffffff;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    flex-shrink: 0;
}

.sidebar-contact-block {
    background: #ffffff;
    padding: 18px;
    border-top: 1px solid #e2e8f0;
}
.sidebar-contact-title {
    font-size: 14.5px;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 12px 0;
}
.contact-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
}
.contact-entry .red-icon {
    color: var(--academic-primary);
    display: flex;
    align-items: center;
}
.contact-entry a {
    color: #475569;
    text-decoration: none;
    font-weight: 600;
}
.contact-entry a:hover {
    color: var(--academic-primary);
}

.sidebar-building-container {
    width: 100%;
}
.sidebar-real-building {
    width: 100%;
    height: auto;
    display: block;
}

/* Right Main Form Area */
.academic-main-form {
    flex: 1;
    min-width: 0;
    position: relative;
}

.form-hero-header {
    text-align: center;
    margin-bottom: 26px;
}
.main-title {
    font-size: 30px;
    font-weight: 900;
    color: #1e293b;
    margin: 0 0 6px 0;
}
.main-title .highlight-text {
    color: var(--academic-primary);
}
.title-underline-pill {
    width: 65px;
    height: 4px;
    background: var(--academic-primary);
    border-radius: 20px;
    margin: 6px auto 12px auto;
}
.subtitle {
    font-size: 14.5px;
    color: #64748b;
    margin: 0 0 22px 0;
}

/* Stepper */
.academic-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 540px;
    margin: 0 auto;
    position: relative;
}
.step-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 2;
}
.step-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #94a3b8;
    color: #64748b;
    font-size: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}
.step-name {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    white-space: nowrap;
    transition: all 0.25s ease;
}
.step-node.active .step-circle {
    background: var(--academic-primary);
    border-color: var(--academic-primary);
    color: #ffffff;
    box-shadow: 0 3px 8px rgba(186, 20, 29, 0.35);
}
.step-node.active .step-name {
    color: var(--academic-primary);
}
.step-line {
    flex: 1;
    height: 2px;
    background: #cbd5e1;
    margin: -22px 10px 0 10px;
    position: relative;
    z-index: 1;
}

/* Card Sections */
.academic-card-section {
    background: #ffffff;
    border-radius: var(--academic-radius);
    padding: 22px 26px;
    margin-bottom: 20px;
    border: 1px solid var(--academic-border);
    box-shadow: var(--academic-shadow);
}

.section-badge-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
.header-icon-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--academic-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.section-heading {
    font-size: 17px;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

/* Fields Grid */
.academic-fields-grid {
    display: grid;
    gap: 18px 20px;
}
.academic-fields-grid.two-cols {
    grid-template-columns: 1fr 1fr;
}
.academic-field-group {
    display: flex;
    flex-direction: column;
}
.academic-field-group.full-width {
    grid-column: 1 / -1;
}

.field-label {
    font-size: 13.5px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 7px;
}
.required-star {
    color: var(--academic-primary);
}
.field-helper-hint {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 4px;
}

/* Inputs, Selects, Textareas */
.input-wrapper, .select-wrapper, .textarea-wrapper {
    position: relative;
    width: 100%;
}
.input-wrapper input,
.select-wrapper select,
.textarea-wrapper textarea {
    width: 100%;
    padding: 11px 14px;
    background: #ffffff;
    border: 1px solid var(--academic-border-input);
    border-radius: var(--academic-radius-sm);
    font-size: 13.5px;
    color: #1e293b;
    transition: all 0.2s ease;
    outline: none;
}
.input-wrapper input::placeholder,
.textarea-wrapper textarea::placeholder {
    color: #94a3b8;
    font-size: 13px;
}
.input-wrapper input:focus,
.select-wrapper select:focus,
.textarea-wrapper textarea:focus {
    border-color: var(--academic-primary);
    box-shadow: 0 0 0 3px rgba(186, 20, 29, 0.12);
}

.input-wrapper.has-icon input,
.select-wrapper.has-icon select {
    padding-inline-start: 40px;
}
.input-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    display: flex;
    align-items: center;
    z-index: 1;
}
[dir="rtl"] .input-wrapper.has-icon .input-icon,
[dir="rtl"] .select-wrapper.has-icon .input-icon {
    right: 14px;
    left: auto;
}
[dir="ltr"] .input-wrapper.has-icon .input-icon,
[dir="ltr"] .select-wrapper.has-icon .input-icon {
    left: 14px;
    right: auto;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #64748b;
    pointer-events: none;
}
[dir="rtl"] .select-wrapper::after {
    left: 14px;
}
[dir="ltr"] .select-wrapper::after {
    right: 14px;
}
.select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-inline-end: 32px;
}

/* Textarea & Word counter */
.textarea-wrapper textarea {
    resize: vertical;
    line-height: 1.5;
}
.counter-wrapper {
    position: relative;
}
.word-counter-badge {
    position: absolute;
    bottom: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    pointer-events: none;
}
[dir="rtl"] .word-counter-badge {
    left: 10px;
}
[dir="ltr"] .word-counter-badge {
    right: 10px;
}

/* Custom Radios & Checkboxes */
.academic-radios-inline {
    display: flex;
    gap: 22px;
    align-items: center;
}
.academic-radio-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}
.academic-radio-box input[type="radio"] {
    display: none;
}
.radio-custom {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #94a3b8;
    background: #ffffff;
    display: inline-block;
    position: relative;
    transition: all 0.2s;
}
.academic-radio-box input[type="radio"]:checked + .radio-custom {
    border-color: var(--academic-primary);
}
.academic-radio-box input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--academic-primary);
}

.academic-checkboxes-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.academic-checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
}
.academic-checkbox-row input[type="checkbox"],
.academic-agreement-checkbox input[type="checkbox"],
.academic-declaration-item input[type="checkbox"] {
    display: none;
}
.checkbox-custom {
    width: 19px;
    height: 19px;
    border-radius: 4px;
    border: 2px solid #94a3b8;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}
input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--academic-primary);
    border-color: var(--academic-primary);
}
input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
}

.academic-checkbox-other-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.other-source-input {
    flex: 1;
    padding: 7px 10px;
    font-size: 12.5px;
    border: 1px solid var(--academic-border-input);
    border-radius: 4px;
}
.other-source-input:focus {
    border-color: var(--academic-primary);
}

/* File Dropzones */
.academic-dropzones-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.dropzone-box {
    display: flex;
    flex-direction: column;
}
.dropzone-area {
    border: 1.5px dashed var(--academic-border-input);
    background: #ffffff;
    border-radius: var(--academic-radius-sm);
    padding: 26px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}
.dropzone-area:hover,
.dropzone-area.dragover {
    border-color: var(--academic-primary);
    background: var(--academic-primary-light);
}
.hidden-file-input {
    display: none;
}
.dropzone-icon {
    color: #475569;
    margin-bottom: 8px;
}
.dropzone-prompt {
    font-size: 13.5px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 4px 0;
}
.dropzone-limits {
    font-size: 11.5px;
    color: #64748b;
    margin: 0;
}
.file-preview-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 6px 10px;
    margin-top: 8px;
}
.preview-filename {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 170px;
}
.preview-size {
    font-size: 11.5px;
    color: #64748b;
}
.remove-file-btn {
    background: none;
    border: none;
    color: #e11d48;
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    padding: 0 4px;
}

/* Declarations List */
.academic-declarations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.academic-declaration-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.45;
    color: #1e293b;
}

/* Agreement & Submit Block */
.form-submission-block {
    text-align: center;
    margin-top: 25px;
}
.academic-agreement-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
}
.submit-action-area {
    display: flex;
    justify-content: center;
}
.academic-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--academic-primary);
    color: #ffffff;
    border: none;
    padding: 13px 44px;
    font-size: 16px;
    font-weight: 800;
    border-radius: var(--academic-radius-sm);
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(186, 20, 29, 0.3);
}
.academic-submit-btn:hover {
    background: var(--academic-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(186, 20, 29, 0.4);
}
.academic-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}
.btn-icon svg {
    display: block;
}

/* Alert response */
.academic-form-alert {
    margin-top: 18px;
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 14.5px;
    font-weight: 700;
    text-align: center;
}
.academic-form-alert.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.academic-form-alert.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Trust Badges Footer */
.academic-trust-badges {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-top: 25px;
    padding: 16px 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.trust-badge-item {
    display: flex;
    align-items: center;
    gap: 10px;
}
.trust-icon {
    color: #64748b;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.trust-label {
    font-size: 12.5px;
    font-weight: 700;
    color: #334155;
    margin: 0;
    line-height: 1.35;
}

/* Corner decorative triangle */
.decorative-corner-accent {
    position: absolute;
    bottom: -15px;
    width: 60px;
    height: 60px;
    background: var(--academic-primary);
    transform: rotate(45deg);
    opacity: 0.9;
    pointer-events: none;
}
[dir="rtl"] .decorative-corner-accent {
    left: -35px;
}
[dir="ltr"] .decorative-corner-accent {
    right: -35px;
}

/* Responsive Styles */
@media (max-width: 900px) {
    .academic-layout-container {
        flex-direction: column !important;
    }
    .academic-sidebar {
        width: 100%;
    }
    .academic-trust-badges {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .academic-form-wrapper {
        padding: 20px 15px;
    }
    .academic-header-bar {
        flex-direction: column !important;
        text-align: center;
    }
    .header-slogan-area {
        text-align: center !important;
    }
    .academic-fields-grid.two-cols,
    .academic-dropzones-grid {
        grid-template-columns: 1fr;
    }
    .academic-stepper .step-name {
        display: none;
    }
    .academic-submit-btn {
        width: 100%;
    }
}
