/* Change Autocomplete styles in Chrome*/
    input:-webkit-autofill,
    input:-webkit-autofill:hover, 
    input:-webkit-autofill:focus,
    textarea:-webkit-autofill,
    textarea:-webkit-autofill:hover,
    textarea:-webkit-autofill:focus,
    select:-webkit-autofill,
    select:-webkit-autofill:hover,
    select:-webkit-autofill:focus {
    border: 1px solid rgb(103, 165, 199);
    -webkit-text-fill-color: rgb(103, 165, 199);
    -webkit-box-shadow: 0 0 0px 1000px #000 inset;
    transition: background-color 5000s ease-in-out 0s;
    }

/* DESIGN SYSTEM & ROOT VARIABLES */
    :root {
        --bg-dark-primary: #121212;
        --bg-dark-secondary: #1e1e1e;

        --brand-primary: #ff7a00;
        --brand-primary-hover: #e06c00;
        --brand-primary-darker: #7b3900;

        --danger-border: #b90000;
        --danger-text: #b90000;

        --text-main: #f5f5f5;
        --text-muted: #b3b3b3;
        --text-muted-x2: #777777;
        --border-color: #333333;
        --success-green: #00cc66;
        --transition-speed: 0.25s;
        --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

        --margin-sm:   4px;
        --margin-md:   8px;
        --margin-ml:  12px;
        --margin-lg:  16px;
        --margin-xl:  24px;
        --margin-xxl: 32px;


        --text-red-main: rgb(235 0 0);
        --text-orange-main: rgb(255 122 0);
        --text-yellow-main: rgb(220 200 15);
        --text-green-main: rgb(35 135 50);
        --text-blue-main: rgb(20 100 175);
        --text-grey-main: rgb(100 100 100);

    }


/* Scroll Bars */
    /* width */
    ::-webkit-scrollbar {
        width: 5px;
    }

    /* Track */
    ::-webkit-scrollbar-track {
        background: var(--border-color);
        /* background: var(--bg-dark-secondary); */
        
    }
    
    /* Handle */
    ::-webkit-scrollbar-thumb {
        background: var(--brand-primary-darker);
        border-radius:3px
    }

    /* Handle on hover */
    ::-webkit-scrollbar-thumb:hover {
        background: var(--brand-primary-hover);
    }




/* BASE STYLING & RESET */
    * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }

    body {
        background-color: var(--bg-dark-primary);
        color: var(--text-main);
        font-family: var(--font-family);
        line-height: 1.5;
        overflow-x: hidden;
    }

    ::-moz-selection { /* Code for Firefox */
        color: #ffffff;
        background: var(--brand-primary-hover);
    }

    ::selection {
        color: #ffffff;
        background: var(--brand-primary-hover);
    }


    ::picker-icon {
        color: green;
    }


/* HEADER COMPONENT */
    .main-header {
        background-color: var(--bg-dark-secondary);
        border-bottom: 2px solid var(--brand-primary);
        padding: 1.2rem 2rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .main-header img{
        height: 30px;
        width: auto;
    }

/* APP LAYOUT STRUCTURE */
    main{
        padding: 1.5rem 1rem;
        margin: auto;
        max-width: 700px;
    }

    section{
        border-radius: 8px;
        background-color: var(--bg-dark-secondary);
        border: 1px solid var(--border-color);
        padding-inline: 0.75rem;
        padding-block: 1.2rem;
        min-height: 80vh;
    }

h1.sub-title{
    font-size: 0.95rem;
    color: var(--text-muted-x2);
    font-weight: 400;
    margin-top: -4px;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
}

a:hover{
    color: var(--brand-primary-hover);
    text-decoration: underline;
}
a:visited{
    color: var(--brand-primary);
    opacity: 90%;
}

.section-divider {
    margin-top: var(--margin-xl);
    margin-bottom: var(--margin-xl);
    border-top: 1px solid var(--border-color);
    border-color: var(--border-color);
}

/* Alerts and Specific Headers for Alert type messages*/
    .alert{
        border-radius: 8px;
        border: 2px var(--border-color) solid;
        background-color: rgb(52, 52, 52);
        color: var(--text-main);
        padding: 4px 16px 16px 16px;
        margin-bottom: var(--margin-lg);
    }
    /* Alert Colours */
        .alert-red{
            border: 1px rgb(176 19 19) solid;
            background-color: rgb(36 4 4 / 50%);
            color: #a76f6f;
        }
        .alert-orange{
            border: 1px rgb(194, 93, 0) solid;
            background-color: rgb(35 11 0 / 50%);
            color: #bf784c;
        }
        .alert-yellow{
            border: 1px rgb(167 149 2) solid;
            background-color: rgba(35, 32, 0, 0.5);
            color: #bfac4c;
        }
        .alert-green{
            border: 1px rgb(0, 90, 15) solid;
            background-color: rgb(0 25 3 / 50%);
            color: #70a76f;
        }
        .alert-blue{
            border: 1px rgb(19, 95, 176) solid;
            background-color: rgb(4 24 36 / 50%);
            color: #6fa1a7;
        }
        .alert-grey{
            border: 1px rgb(85, 85, 85) solid;
            background-color: rgb(80 80 80 / 50%);
            color: #999;
        }


    .alert h4{
        color: white;
    }

    .alert-close {
        color: white;
        float: right;
        font-size: 22px;
        line-height: 20px;
        cursor: pointer;
        transition: 0.3s;
        opacity: 0.9;
    }
    .alert-close:hover {
        opacity: 0.3;
    }

/* TABS */
    .tab-row{
        display: flex;
        justify-content: center;
        align-items: end;
        font-size: 0.7em;
        text-align: center;
        margin-bottom: var(--margin-lg);
    }
    .tab-opt{
        color: var(--text-muted-x2);
        padding-inline: 4px;
        border-bottom: 4px solid var(--border-color);
        vertical-align: bottom;
    }
    .tab-opt.active{
        color: var(--text-main);
        border-bottom: 4px solid var(--brand-primary);
    }
    .tab-opt.complete{
        color: var(--text-muted-x2);
        border-bottom: 4px solid var(--brand-primary-darker);
    }

/* FORMS */
    .form-row-inline{
        display: flex;
        justify-content: space-between;
        align-items: end;
        font-size: 0.7em;
        text-align: center;
        margin-bottom: var(--margin-lg);
    }

    .form-input-row-inline {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: var(--margin-md);
        margin-bottom: var(--margin-md);
        color-scheme: dark;
    }

    .inline-row-large {
        flex: 0 0 75%;
    }

    .readonly-input {
        background-color: #222222;
        color: var(--text-muted);
        cursor: not-allowed;
    }

    .form-checkbox {
        display: inline-flex;
        align-items: flex-start;
        gap: 0.8rem;
        font-size: 0.85rem;
        max-width: 500px;
        margin-bottom: 24px;
    }

    .form-checkbox input {
        accent-color: var(--brand-primary);
        margin-top: 0.2rem;
        height: 16px;
        width: 16px;
        margin-left: 24px;
        margin-bottom: 0px;
    }

    .form-input-group{
        position: relative;
        margin-bottom: var(--margin-lg);
    }

    .form-input-group .input-icon{
        position: absolute;
        right: 10px;
        top: 38px;
    }

    .input-icon-clickable{
        cursor: pointer;
        color: #999;
    }

    .form-input-group p{
        color: var(--text-muted-x2);
        text-align: right;
        padding-right: var(--margin-md);
        font-size: 0.75em;
    }

    input, select, textarea {
        width: 100%;
        height: 44px;
        background-color: var(--bg-dark-primary);
        border: 1px solid var(--border-color);
        color: var(--text-main);
        padding-left: var(--margin-lg);
        padding-right: var(--margin-lg);
        /* padding: 0.75rem 1rem; */
        border-radius: 6px;
        font-family: var(--font-family);
        font-size: 0.95rem;
        outline: none;
        transition: border-color var(--transition-speed);
    }

    textarea {
        height: 88px;
        padding: var(--margin-ml) var(--margin-lg);
        /* padding: var(--margin-lg) 1rem; */
    }

    select {
        color: #999;
    }

    select option {
        color: var(--text-main);
    }

    select:has(option:checked:not([value])),
    select:has(option:checked:not([value=""])) {
        color: var(--text-main);
    }

    select:has(option:checked:not([value])) option,
    select:has(option:checked:not([value=""])) option {
        color: var(--text-main);
    }



    input[type="date" i] {
        color-scheme: dark;
        color: #999;
        font-family: var(--font-family);
        font-size: 0.95rem;
    }

    input[type="number" i] {
        color-scheme: dark;
    }

    input[type="password" i] {
        color-scheme: dark;
        color: #999;
        font-size: 0.95rem;
    }

    input[type="file"] {
        color-scheme: dark;
        padding-top: 9px;
    }

    input[type="file"]::file-selector-button {
        margin-right: 16px;
        background-color: rgba(255, 122, 0, 0.01);
        color: var(--brand-primary-darker);
        border: 1px solid rgba(87, 43, 1, 0.5);
        cursor: pointer;
        font-size: 0.85em;
        border-radius: 4px;
        transition: background-color 0.2s ease-in-out;
        padding: 4px 8px;
    }

    input[type="file"]::file-selector-button:hover {
        background-color: rgba(255, 122, 0, 0.1);
        color: var(--brand-primary-hover);
        border: 1px solid rgba(87, 43, 1, 0.8);
    }

    .file-line {
        color: var(--text-muted) !important;
        margin-top: var(--margin-sm);
    }

    .file-line:hover {
        color: var(--text-main);
    }

    .file-line-icon {
        color: var(--brand-primary-hover);
        margin-left: var(--margin-lg);
        cursor: pointer;
    }

    .file-line-icon:hover {
        color: var(--brand-primary);
    }
    

    input:focus, select:focus {
        border-color: var(--brand-primary);
    }
    

    input:read-only {
        color: var(--text-muted-x2);
        cursor: not-allowed;
    }
    .form-checkbox input:read-only {
        cursor: pointer;
        color: var(--text-muted-x2);
    }

    .invalid-input {
        border-color: var(--danger-border);
    }

    .invalid-input-nb {
        border-color: var(--danger-border) !important;
    }

    label {
        padding-left: 8px;
        font-size: 0.85rem;
        color: var(--text-muted);
        font-weight: 500;
    }

    label span{
        color: var(--brand-primary-darker);
        padding-left: 2px;
    }


/* BUTTONS */
    button {
        margin-bottom: var(--margin-lg);
        max-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        padding: 0.75rem 1.5rem;
        border-radius: 6px;
        cursor: pointer;
        border: none;
        transition: all var(--transition-speed);
        text-transform: uppercase;
        font-size: 0.85rem;
    }

    .btn-main-submit{
        color: white;
        background: black;
        height: 64px;
        font-size: 1.1em;
    }

    .btn-main-submit:hover{
        color: var(--brand-primary);
        background: #111;
    }

    .btn-main-subtle-close{
        width: 200px;
        background: #ffffff55;
        color: #7b3900;
    }

    .btn-main-subtle-close:hover{
        background: #ffffffaa;
        color: #b35400;
    }

    .btn-primary {
        background-color: var(--brand-primary);
        color: #121212;
    }

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

    .btn-secondary {
        background-color: black;
        border: 1px solid #999;
        color: var(--text-main);
        font-size: 0.65em;
        font-weight: 400;
    }

    .btn-secondary:hover {
        background-color: rgb(15, 15, 15);
    }

    .btn-subdued {
        background-color: #ffffff0d;
        border: 1px solid var(--border-color);
        color: var(--text-muted-x2);
    }

    .btn-subdued:hover {
        background-color: #ffffff3d;
        border: 1px solid var(--border-color);
        color: var(--text-muted);
    }

    .btn-accent {
        background-color: rgba(255, 122, 0, 0.1);
        color: var(--brand-primary);
        border: 1px solid var(--brand-primary);
    }

    .btn-accent:hover {
        background-color: rgba(255, 122, 0, 0.2);
    }

    .btn-sm {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
        font-weight: 500;
    }

    .btn-xs {
        padding: 0.4rem 0.8rem;
        font-size: 0.6rem;
        font-weight: 400;
    }

    .btn-block {
        width: 100%;
    }

    .button-group-vertical {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .button-row {
        display: flex;
        justify-content: center;
        /* justify-content: space-between; */
        align-items: center;
    }



/* Panel or cards sections */
    .app-card-info-container {
        display: flex;
        align-items: center; /* Vertically centers the icon with the text */
        gap: 16px; /* Adds space between the icon and the text block */
        border: 1px var(--border-color) solid;
        border-radius: 8px;
        margin-bottom: var(--margin-md);
    }
    .app-card-info-icon {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 40px;
        height: 40px;
        background-color: var(--border-color);
        margin: 4px;
        border-radius: 4px;
    }
    .app-card-info-icon i {
        font-size: 18px; /* Adjust size as needed */
        color: var(--brand-primary);
    }
    .app-card-info-details p {
        margin: 0; 
    }
    .app-card-info-type {
        font-size: 13px;
        color: var(--text-muted-x2);
        font-weight: 400;
    }
    .app-card-info-data {
        font-size: 16px;
        color: var(--text-main);
        font-weight: 600; /* Makes the text bold */
        /* margin-top: 2px; */
    }



/* Terms and Conditions */
    .tcs-and-cs{
        color: white;
    }
    .tcs-and-cs-scrollbox {
        width: 95%;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        margin-inline: auto;
        height: 300px;
        overflow-y: scroll;
        margin-bottom: var(--margin-xl);
        padding: 12px;
        resize:vertical;
        color-scheme: dark;
    }

    .tcs-and-cs-scrollbox::-webkit-scrollbar-track {
        background: transparent; /* fully transparent track */
    }

    /* Handle */
    .tcs-and-cs-scrollbox::-webkit-scrollbar-thumb {
        background: var(--brand-primary-hover);
        border-radius:3px
    }

    /* Handle on hover */
    .tcs-and-cs-scrollbox::-webkit-scrollbar-thumb:hover {
        background: var(--brand-primary);
    }




    .tcs-and-cs-scrollbox::-webkit-resizer {
        /* Match this to your track color */
        background: linear-gradient(to bottom right,#1e1e1e 50%,var(--brand-primary) 50%);
        /* background: linear-gradient(to bottom right,#1e1e1e 50%,orange 50% 60%,#1e1e1e 60% 70%,orange 70% 80%,#1e1e1e 80% 90%,orange 90%); */
    }

    .tcs-and-cs-scrollbox::-webkit-resizer:hover {
        background-color: #e20000;
    }







    .tcs-and-cs h2 {
            color: white;
            margin-bottom: 16px;
            text-transform: uppercase;
    }
    .tcs-and-cs h4 {
            margin-top: 8px;
            margin-bottom: 8px;
            color: var(--brand-primary);
            text-transform: uppercase;
    }
    .tcs-and-cs p {
            color: var(--text-muted);
            margin-bottom: 16px;
            margin-left: 24px;
            margin-right: 16px;
    }
    .tcs-and-cs .tcs-list{
            margin-left: 48px;
    }
    .tcs-and-cs .tcs-list-2{
            margin-left: 72px;
    }
    .tcs-and-cs span {
            color: var(--brand-primary-hover);
    }

    .tcs-and-cs ul {
        margin-left: 72px;
        color: var(--brand-primary-hover);
        margin-bottom: 16px;
        margin-top: -12px;
    }

    .tcs-and-cs ul span {
        color: var(--text-muted);
    }


    .tcs-and-cs .second-level-ul {
        margin-top: 0px;
        margin-left: 48px;
    }





    .enrolment-agreement-signatures-container {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        flex-wrap: wrap;
        /* margin-bottom: var(--margin-xl); */
        margin-top: var(--margin-lg);
        gap: 8px;
    }

    .enrolment-agreement-signature-group {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        text-align: center;
        flex: 1;
        flex-grow: 1;
        flex-shrink: 0;
        flex-basis: 0;
    }

    .enrolment-agreement-signature-div {
        text-align: center;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .enrolment-agreement-signature-img {
        max-width: 200px;
        height: auto;
        margin-inline: auto;
        /* filter: invert(100%); */
    }

    .enrolment-agreement-signature-btn-container {
        width: 100%;
        padding-inline: 16px;
        padding-top: 16px;
    }


    #enrolment-agreement-signature-feepayer {
        color: rgb(127, 101, 151)
    }

    #enrolment-agreement-signature-guardian {
        color: rgb(101, 151, 138)
    }

    #enrolment-agreement-signature-student {
        color: rgb(142, 145, 83)
    }





                            .crs-signature-wrapper {
                                position: relative;
                                width: 400px;
                                height: 200px;
                                margin-inline: auto;
                                -moz-user-select: none;
                                -webkit-user-select: none;
                                -ms-user-select: none;
                                user-select: none;
                                border: 1px rgb(150, 150, 150) dashed;
                                /* border: 1px rgb(61, 61, 61) solid; */
                                border-radius: 8px;
                                background-color: transparent;
                                /* background-color: white; */
                            }

                            .crs-signature-btn-wrapper {
                                width: 400px;
                                margin-inline: auto;
                                padding-inline: var(--margin-md);
                                text-align: right;
                            }

                            .crs-signature-form-btns-wrapper {
                                display: flex;
                                flex-direction: row;
                                justify-content: space-between;
                                flex-wrap: wrap;
                                gap: 8px;
                            }

                            .crs-signature-form-btns-wrapper button {
                                flex: 1;
                                flex-grow: 1;
                                flex-shrink: 0;
                                flex-basis: 0;
                            }


                            .crs-signature-pad {
                                position: absolute;
                                left: 0;
                                top: 0;
                                width:400px;
                                height:200px;
                            }

                            .crs-signature-qr-image{
                                width: 300px;
                                border-radius: 8px;
                                max-width: 100%
                            }

                            .crs-signature-qr-copy-link{
                                margin-inline: auto;
                                max-width: 300px;
                            }




/* MODALS */

    #ready-for-submission{
        display: block;
    }

    #ready-for-submission .modal-content {
        min-height: 60vh;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        background-color: var(--brand-primary);
        color: black;
        text-align: center;
    }



/* The Modal (background) */
    .modal {
        display: none; /* Hidden by default */
        position: fixed; /* Stay in place */
        z-index: 100; /* Sit on top */
        padding-top: 100px; /* Location of the box */
        left: 0;
        top: 0;
        width: 100%; /* Full width */
        height: 100%; /* Full height */
        overflow: auto; /* Enable scroll if needed */
        /* background-color: rgb(0,0,0); */
        /* background-color: rgba(0,0,0,0.4); */
        background-color: #140a00;
        background-color: #140a0099;

    }
    .modal-content {
        background-color: #0c0c0ce6;
        /* background-color: #2d2d2d; */
        margin-inline: auto;
        margin-top: 32px;
        z-index: 200;
        padding: 24px;
        border: 1px solid #5a5a5a;
        border-radius: 8px;
        width: 75%;
        max-width: 575px;
        backdrop-filter: blur(2px);
        box-shadow: 0 5px 5px rgb(0 0 0 / 40%);
    }

    .model-close {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    margin-top: -24px;
    margin-right: -12px;
    }

    .model-close:hover,
    .model-close:focus {
    color: var(--brand-primary);
    text-decoration: none;
    cursor: pointer;
    }


/* HELPERS / HIDDEN SECTIONS */
.hidden-section {
    display: none !important;
}

.hidden-section.visible {
    display: block !important;
}

.text-orange {
    color: var(--brand-primary);
}


.section-form-divider-something {
    font-size: 0.85rem;
    color: var(--brand-primary-hover);
    border-bottom: 1px var(--border-color) solid;
    margin-bottom: var(--margin-lg);
    margin-top: var(--margin-xl);
}

/* NOTICE SECTION */
.applicant-notice-container{
    text-align: center;
}

.applicant-notice-container h3 {
    color: var(--brand-primary);
}

/* FEEDBACK HUB & STATS DISPLAY */
.portal-feedback-card {
    background-color: var(--bg-dark-secondary);
    border: 1px solid var(--border-color);
    padding: 3rem 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}


.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-top: 5px solid var(--brand-primary);
    border-radius: 50%;
    display: block;
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

/* FOOTER */
    footer {
        text-align: center;
        color: var(--text-muted-x2);
    }


/* Custom Element IDs */
    #additional-section-for-minors {
        border: 1px solid var(--danger-border);
        border-radius: 8px;
        padding: 20px;
        margin-bottom: var(--margin-xl);
    }


    #additional-section-for-minors ::selection {
        color: #ffffff;
        background: #e37c7c;
    }



/* ANIMATIONS */
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
    }

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

/* RESPONSIVE BREAKPOINTS */
    @media (max-width: 900px) {
        .portal-container {
            grid-template-columns: 1fr;
        }
        .workflow-sidebar {
            border-right: none;
            border-bottom: 1px solid var(--border-color);
        }
        .form-row {
            flex-direction: column;
        }
        .width-50, .width-30 {
            max-width: 100%;
        }

    }


    @media (max-width: 700px) {
        .tab-row {
            font-size: 0.5em;
        }
        footer {
            font-size: 0.7em;
        }

        .tcs-and-cs p {
            margin-left: 16px;
            margin-right: 16px;
        }
        .tcs-and-cs .tcs-list{
                margin-left: 24px;
        }
        .tcs-and-cs .tcs-list-2{
                margin-left: 36px;
        }

    }



    @media (max-width: 350px) {
        .tab-row {
            display: none;
        }
        footer {
            font-size: 0.5em;
        }
    }




/* HANDLING PRINTING */
    @media print {
        .main-header {
            display:none;
        }

        section{
            border: 0px none var(--border-color);
        }

        .afda-logo-main-screen {
            display: none;
        }

        .afda-logo-main-print {
            display: block;
        }

    }