/* Auto-extracted from resources/views/institution-application/create.blade.php */

.form-card {
        background: white;
        border-radius: 12px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.05);
        padding: 10px;
    }
    .card-section {
        border-bottom: 1px solid #f0f0f0;
        padding: 25px;
    }
    .card-section:last-child {
        border-bottom: none;
    }
    .card-section h3 {
        color: #333;
        font-size: 18px;
        font-weight: 700;
        margin: 0 0 20px 0;
        word-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
    }
    .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
    .grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
    
    .form-group label {
        display: block;
        font-size: 13px;
        font-weight: 600;
        color: #555;
        margin-bottom: 8px;
    }
    .required { color: #f44336; }
    
    input[type="text"], input[type="email"], input[type="number"], input[type="tel"], select, textarea {
        width: 100%;
        padding: 12px 15px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        background: #fdfdfd;
        font-size: 14px;
        transition: 0.3s;
    }
    input:focus, select:focus, textarea:focus {
        border-color: #2971b7;
        box-shadow: 0 0 0 3px rgba(41, 113, 183, 0.1);
        outline: none;
    }
    textarea { height: 100px; resize: none; }
    
    .checkbox-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        width: 100%;
        box-sizing: border-box;
    }

    @media (min-width: 1600px) {
        .checkbox-grid {
            grid-template-columns: repeat(4, 1fr);
        }
    }

    @media (max-width: 1440px) {
        .checkbox-grid {
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
        }
    }

    @media (max-width: 1300px) {
        .checkbox-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }
    }

    @media (max-width: 1100px) {
        .checkbox-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
        }
    }
    
    .custom-checkbox {
        display: flex;
        align-items: center;
        position: relative;
        padding-left: 30px;
        cursor: pointer;
        font-size: 14px;
        user-select: none;
        white-space: nowrap;
        writing-mode: horizontal-tb;
        text-orientation: mixed;
    }
    .custom-checkbox input { position: absolute; opacity: 0; cursor: pointer; }
    .checkmark {
        position: absolute;
        top: 0;
        left: 0;
        height: 20px;
        width: 20px;
        background-color: #eee;
        border-radius: 4px;
    }
    .custom-checkbox:hover input ~ .checkmark { background-color: #ccc; }
    .custom-checkbox input:checked ~ .checkmark { background-color: #2971b7; }
    .checkmark:after {
        content: "";
        position: absolute;
        display: none;
    }
    .custom-checkbox input:checked ~ .checkmark:after { display: block; }
    .custom-checkbox .checkmark:after {
        left: 7px;
        top: 3px;
        width: 5px;
        height: 10px;
        border: solid white;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
    }
    
    .upload-box {
        border: 2px dashed #ddd;
        border-radius: 12px;
        padding: 40px;
        background: #fafafa;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: 0.3s;
    }
    .upload-box:hover { border-color: #2971b7; background: #f0f7ff; }
    .btn-upload {
        background: #2971b7;
        color: white;
        border: none;
        padding: 8px 30px;
        border-radius: 6px;
        font-weight: 600;
        margin: 15px 0;
    }
    
    .accordion-item {
        border: 1px solid #eee;
        border-radius: 8px;
        margin-bottom: 10px;
        overflow: hidden;
    }
    .accordion-header {
        padding: 15px 20px;
        background: #fff;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        font-weight: 600;
        color: #444;
    }
    .accordion-header:hover { background: #f9f9f9; }
    .accordion-content {
        padding: 20px;
        background: #fafafa;
        display: none;
        border-top: 1px solid #eee;
    }
    
    .btn-add {
        background: #2971b7;
        color: white;
        border: none;
        padding: 8px 20px;
        border-radius: 6px;
        font-weight: 600;
        margin-top: 10px;
        cursor: pointer;
    }
    
    .btn-step-nav:hover { opacity: 0.9; transform: translateY(-1px); }

    /* Responsive Design */
    @media (max-width: 1200px) {
        .affiliation-container {
            padding: 0 15px;
        }
    }

    @media (max-width: 992px) {
        .grid-4 {
            grid-template-columns: repeat(2, 1fr);
        }
        .grid-3 {
            grid-template-columns: repeat(2, 1fr);
        }
        .checkbox-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }

    @media (max-width: 900px) {
        .checkbox-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }
    }

    @media (max-width: 768px) {
        .grid-4,
        .grid-3,
        .grid-2 {
            grid-template-columns: 1fr;
            gap: 15px;
        }

        .checkbox-grid {
            grid-template-columns: 1fr;
            gap: 10px;
        }

        .card-section {
            padding: 20px 15px;
        }

        .card-section h3 {
            font-size: 15px;
            line-height: 1.3;
            word-wrap: break-word;
            word-break: break-word;
        }

        .upload-box {
            padding: 25px 15px;
        }

        /* Step indicator responsive - hide on mobile */
        .step-indicator {
            display: none !important;
        }

        /* Header responsive */
        .affiliation-container > div > div > div:first-child {
            flex-direction: column;
            align-items: flex-start;
            gap: 15px;
        }

        .affiliation-container > div > div > div:first-child > div:last-child {
            width: 100%;
            justify-content: flex-start;
        }

        .btn-step-nav {
            padding: 8px 15px;
            font-size: 14px;
        }
    }

    @media (max-width: 576px) {
        .card-section {
            padding: 15px 10px;
        }

        .card-section h3 {
            font-size: 14px;
            margin-bottom: 15px;
            line-height: 1.4;
            word-wrap: break-word;
            word-break: break-word;
        }

        .form-group label {
            font-size: 12px;
        }

        input[type="text"],
        input[type="email"],
        input[type="number"],
        input[type="tel"],
        select,
        textarea {
            padding: 10px 12px;
            font-size: 13px;
        }

        .btn-add,
        .btn-upload {
            padding: 8px 16px;
            font-size: 13px;
        }

        .accordion-header {
            padding: 12px 15px;
            font-size: 14px;
        }

        .accordion-content {
            padding: 15px;
        }

        /* Step indicator circles smaller on mobile */
        .step-indicator > div > div {
            width: 32px;
            height: 32px;
            font-size: 14px;
        }
    }

    /* Full screen optimization */
    @media (min-width: 1400px) {
        .main-content {
            max-width: 1200px;
        }
    }

    /* Override inline styles for better mobile experience */
    @media (max-width: 768px) {
        .header-section {
            padding: 20px 0 40px 0 !important;
        }

        .header-content {
            padding: 0 15px !important;
        }

        .main-content {
            margin: -30px 15px 0 15px !important;
            padding: 0 !important;
        }

        /* Step indicator mobile adjustments */
        .step-indicator {
            margin-top: 30px !important;
            max-width: 100% !important;
            padding: 0 10px !important;
            flex-wrap: nowrap !important;
            justify-content: center !important;
            gap: 8px !important;
            overflow-x: auto !important;
        }

        .step-indicator > div {
            margin: 0 !important;
            flex-shrink: 0 !important;
        }

        /* Step circles mobile */
        .step-indicator > div > div {
            width: 35px !important;
            height: 35px !important;
            font-size: 14px !important;
        }

        /* Header text mobile */
        .header-top > div:first-child h1 {
            font-size: 20px !important;
        }

        .header-top > div:first-child > div {
            font-size: 12px !important;
        }
    }

    @media (max-width: 1366px) {
        .main-content {
            padding: 0 15px !important;
            max-width: 100% !important;
        }

        .form-card {
            padding: 10px !important;
        }

        .card-section {
            padding: 20px 15px !important;
        }
    }

    @media (max-width: 1200px) {
        .main-content {
            padding: 0 10px !important;
            max-width: 100% !important;
        }

        .card-section {
            padding: 20px 10px !important;
        }
    }

    @media (max-width: 480px) {
        .step-indicator > div > div {
            width: 30px !important;
            height: 30px !important;
            font-size: 12px !important;
        }

        .header-top > div:first-child h1 {
            font-size: 18px !important;
        }

        .btn-step-nav {
            padding: 8px 12px !important;
            font-size: 13px !important;
        }
    }

    /* Ensure proper spacing on all screens */
    .affiliation-container {
        width: 100%;
        overflow-x: hidden;
    }

    .form-card {
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .main-content {
        overflow-x: hidden;
        width: 100%;
        box-sizing: border-box;
    }

    /* Fix horizontal scroll on mobile */
    @media (max-width: 768px) {
        * {
            max-width: 100%;
            box-sizing: border-box;
        }

        .u-flex {
            flex-wrap: wrap !important;
        }

        .u-gap-20 {
            gap: 10px !important;
        }
    }

    /* Prevent horizontal overflow on all screens */
    .card-section {
        overflow-x: hidden;
        width: 100%;
        box-sizing: border-box;
    }

    .grid-3, .grid-2, .grid-4 {
        width: 100%;
        box-sizing: border-box;
    }

    .form-group {
        width: 100%;
        box-sizing: border-box;
    }

    @media (max-width: 1366px) {
        .checkbox-grid {
            grid-template-columns: repeat(3, 1fr);
        }
    }

    @media (max-width: 1280px) {
        .checkbox-grid {
            grid-template-columns: repeat(3, 1fr);
        }
    }

    @media (max-width: 1200px) {
        .checkbox-grid {
            grid-template-columns: repeat(3, 1fr);
        }
    }

    @media (max-width: 1024px) {
        .checkbox-grid {
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
        }
    }

    @media (max-width: 850px) {
        .checkbox-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }

    @media (max-width: 600px) {
        .checkbox-grid {
            grid-template-columns: 1fr;
            gap: 10px;
        }
    }
