/* ============================================
   JHUB AFRICA - Application Form Styles
   Completely Rebuilt with Modern Design
   ============================================ */

/* === ROOT VARIABLES === */
:root {
    --jhub-primary: #2c409a;
    --jhub-primary-dark: #1e2d6b;
    --jhub-primary-light: #3f57c4;
    --jhub-success: #3fa845;
    --jhub-warning: #ffa726;
    --jhub-danger: #dc3545;
    --jhub-info: #17a2b8;

    --text-dark: #2d3748;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --bg-light: #f7fafc;
    --white: #ffffff;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.15);

    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* === GLOBAL STYLES === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf3 100%);
    line-height: 1.6;
    min-height: 100vh;
}

/* === HEADER === */
.app-header {
    background: var(--white);
    border-bottom: 3px solid var(--jhub-primary);
    box-shadow: var(--shadow-md);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 70px;
    display: flex;
    align-items: center;
}

/* Logo Styling - Perfectly Sized to Fit */
.logo-container {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    max-height: 70px;
}

.brand-logo {
    height: 50px;
    width: auto;
    max-width: 250px;
    max-height: 50px;
    object-fit: contain;
    transition: var(--transition);
}

.brand-logo:hover {
    transform: scale(1.02);
}

/* Responsive logo sizing */
@media (max-width: 768px) {
    .logo-container {
        max-height: 60px;
    }

    .brand-logo {
        height: 45px;
        max-height: 45px;
        max-width: 220px;
    }
}

@media (max-width: 480px) {
    .logo-container {
        max-height: 50px;
    }

    .brand-logo {
        height: 40px;
        max-height: 40px;
        max-width: 180px;
    }
}

/* === NAVIGATION === */
.app-nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.app-nav .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
    border: 2px solid transparent;
    font-size: 0.95rem;
}

.app-nav .nav-link:hover {
    background: var(--jhub-primary);
    color: var(--white);
    border-color: var(--jhub-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.app-nav .nav-link i {
    font-size: 1rem;
}

@media (max-width: 992px) {
    .app-nav {
        justify-content: flex-end;
        gap: 0.5rem;
    }

    .app-nav .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
    .app-nav {
        justify-content: center;
        margin-top: 0.5rem;
        width: 100%;
    }

    .app-nav .nav-link span {
        display: none;
    }

    .app-nav .nav-link {
        padding: 0.5rem 0.75rem;
    }
}

/* === HERO SECTION === */
.hero-section {
    background: linear-gradient(135deg, var(--jhub-primary) 0%, var(--jhub-primary-dark) 100%);
    color: var(--white);
    padding: 3rem 0;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.05)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    opacity: 0.3;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 1.5rem;
    opacity: 0.95;
    position: relative;
}

.hero-description {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
    line-height: 1.8;
    position: relative;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .hero-description {
        font-size: 1rem;
    }
}

/* === PROGRESS INDICATOR === */
.progress-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 900px;
    margin: 0 auto 3rem;
    padding: 2rem;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
}

.step-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-light);
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: var(--transition);
    position: relative;
    z-index: 2;
}

.progress-step.active .step-circle {
    background: var(--jhub-primary);
    border-color: var(--jhub-primary);
    color: var(--white);
    box-shadow: 0 0 0 4px rgba(44, 64, 154, 0.2);
}

.progress-step.completed .step-circle {
    background: var(--jhub-success);
    border-color: var(--jhub-success);
    color: var(--white);
}

.progress-step.completed .step-circle::after {
    content: '\2713';
    position: absolute;
    font-size: 1.5rem;
}

.step-label {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    transition: var(--transition);
}

.progress-step.active .step-label {
    color: var(--jhub-primary);
}

.progress-step.completed .step-label {
    color: var(--jhub-success);
}

.progress-line {
    height: 3px;
    background: var(--border-color);
    flex: 1;
    margin: 0 1rem;
    position: relative;
    top: -30px;
}

.progress-step.completed + .progress-line {
    background: var(--jhub-success);
}

@media (max-width: 768px) {
    .progress-container {
        padding: 1.5rem 1rem;
    }

    .step-circle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .step-label {
        font-size: 0.75rem;
    }

    .progress-line {
        margin: 0 0.5rem;
        top: -25px;
    }
}

/* === FORM CARD === */
.form-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .form-card {
        padding: 2rem 1.5rem;
    }
}

/* === FORM SECTIONS === */
.form-section {
    display: none;
}

.form-section.active {
    display: block;
    animation: fadeIn 0.4s ease-in-out;
}

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

.section-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.section-header h2 {
    color: var(--jhub-primary);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0;
}

/* === FORM GROUPS === */
.form-group {
    margin-bottom: 2rem;
}

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

.form-label.required::after {
    content: ' *';
    color: var(--jhub-danger);
    font-weight: 700;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--jhub-primary);
    box-shadow: 0 0 0 3px rgba(44, 64, 154, 0.1);
}

.form-control.is-invalid {
    border-color: var(--jhub-danger);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

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

.form-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.invalid-feedback {
    display: none;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--jhub-danger);
}

.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Character Counter */
.char-counter {
    text-align: right;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* === FILE UPLOAD ZONE === */
.file-upload-zone {
    border: 3px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-light);
}

.file-upload-zone:hover,
.file-upload-zone.dragover {
    border-color: var(--jhub-primary);
    background: rgba(44, 64, 154, 0.05);
}

.upload-content h4 {
    color: var(--text-dark);
    margin: 1rem 0 0.5rem;
    font-weight: 600;
}

.upload-content p {
    color: var(--text-muted);
    margin: 0.5rem 0;
}

.upload-icon {
    font-size: 4rem;
    color: var(--jhub-primary);
    opacity: 0.7;
}

.upload-info {
    margin-top: 1.5rem !important;
    color: var(--text-muted);
    font-size: 0.875rem;
}

#filePreview {
    margin-top: 1.5rem;
}

.file-preview-card {
    background: var(--bg-light);
    border: 2px solid var(--jhub-success);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-preview-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-preview-info i {
    font-size: 2rem;
    color: var(--jhub-success);
}

.file-remove-btn {
    background: var(--jhub-danger);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.file-remove-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* === INFO BOXES === */
.info-box {
    background: var(--bg-light);
    border-left: 4px solid var(--jhub-primary);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.info-box i {
    font-size: 1.5rem;
    color: var(--jhub-primary);
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.info-box strong {
    color: var(--text-dark);
}

.info-box ul {
    margin: 0.5rem 0 0 1.5rem;
}

.info-box li {
    margin-bottom: 0.25rem;
}

.info-box.info-warning {
    background: #fff8e6;
    border-left-color: var(--jhub-warning);
}

.info-box.info-warning i {
    color: var(--jhub-warning);
}

.info-box.info-primary {
    background: #e6f0ff;
    border-left-color: var(--jhub-primary);
}

.info-box a {
    color: var(--jhub-primary);
    font-weight: 600;
    text-decoration: underline;
}

.info-box a:hover {
    color: var(--jhub-primary-dark);
}

/* === CUSTOM CHECKBOX === */
.custom-checkbox {
    position: relative;
    padding-left: 2.5rem;
}

.custom-checkbox input[type="checkbox"] {
    position: absolute;
    left: 0;
    top: 0.25rem;
    width: 1.5rem;
    height: 1.5rem;
    cursor: pointer;
}

.custom-checkbox label {
    cursor: pointer;
    font-weight: 500;
    color: var(--text-dark);
    margin: 0;
}

.custom-checkbox a {
    color: var(--jhub-primary);
    font-weight: 700;
    text-decoration: underline;
}

.custom-checkbox a:hover {
    color: var(--jhub-primary-dark);
}

.custom-checkbox .invalid-feedback {
    padding-left: 0;
}

/* === FORM NAVIGATION === */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.nav-spacer {
    flex: 1;
}

/* === BUTTONS === */
.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

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

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

.btn-secondary {
    background: var(--text-muted);
    color: var(--white);
}

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

.btn-success {
    background: var(--jhub-success);
    color: var(--white);
}

.btn-success:hover {
    background: #348a39;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    background: transparent;
    color: var(--jhub-primary);
    border: 2px solid var(--jhub-primary);
}

.btn-outline-primary:hover {
    background: var(--jhub-primary);
    color: var(--white);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

@media (max-width: 576px) {
    .form-navigation {
        flex-direction: column;
        gap: 1rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .nav-spacer {
        display: none;
    }
}

/* === HELP CARD === */
.help-card {
    background: linear-gradient(135deg, var(--jhub-primary) 0%, var(--jhub-primary-dark) 100%);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.help-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--white);
}

.help-icon {
    font-size: 3rem;
    opacity: 0.9;
}

.help-text h5 {
    margin: 0 0 0.5rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.help-text p {
    margin: 0.25rem 0;
}

.help-text strong {
    color: var(--jhub-warning);
}

@media (max-width: 576px) {
    .help-content {
        flex-direction: column;
        text-align: center;
    }
}

/* === ALERT CONTAINER === */
#alertContainer {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border-left: 4px solid;
    animation: slideDown 0.3s ease-out;
}

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

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left-color: var(--jhub-success);
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left-color: var(--jhub-danger);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: var(--jhub-info);
}

.alert-dismissible {
    padding-right: 3rem;
    position: relative;
}

.btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.5;
}

.btn-close:hover {
    opacity: 1;
}

/* === FOOTER === */
.app-footer {
    background: var(--text-dark);
    color: var(--white);
    padding: 2rem 0;
    margin-top: 4rem;
}

.app-footer p {
    margin: 0.5rem 0;
}

.footer-links {
    font-size: 0.9rem;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    margin: 0 0.5rem;
}

.footer-links a:hover {
    color: var(--jhub-warning);
    text-decoration: underline;
}

/* === LOADING SPINNER === */
.fa-spin {
    animation: fa-spin 1s infinite linear;
}

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

/* === RESPONSIVE ADJUSTMENTS === */
@media (max-width: 992px) {
    .hero-section {
        padding: 2rem 0;
    }

    .form-card {
        padding: 2rem;
    }
}

@media (max-width: 576px) {
    .section-header h2 {
        font-size: 1.5rem;
    }

    .file-upload-zone {
        padding: 2rem 1rem;
    }

    .upload-icon {
        font-size: 3rem;
    }
}
