body {
    padding-top: 80px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.apply-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 20px 0;
}

.apply-container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    animation: fadeInUp 0.8s ease-out;
}

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

.apply-header {
    background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 100%);
    color: white;
    padding: 30px 20px;
    border-radius: 20px 20px 0 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.apply-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255, 213, 79, 0.1);
    border-radius: 50%;
}

.apply-header h2 {
    color: #FFD54F;
    font-weight: 900;
    font-size: 1.8rem;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.apply-header p {
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

.apply-icon {
    font-size: 3rem;
    color: #FFD54F;
    margin-bottom: 15px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

.apply-form {
    background: white;
    padding: 20px;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 20px 60px rgba(27, 94, 32, 0.3);
}

.form-step {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 5px solid #FFD54F;
    transition: all 0.3s ease;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.form-step:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(27, 94, 32, 0.1);
}

.form-label {
    color: #1B5E20;
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.form-label i {
    margin-right: 8px;
    color: #FFD54F;
    font-size: 1.1rem;
}

.form-control, .form-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s;
    box-sizing: border-box !important;
    max-width: 100% !important;
    display: block;
}

/* Specific styling for select dropdown */
.form-select, select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231B5E20' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 40px !important;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    width: 100% !important;
}

/* Override any Django form widget styling */
select[name="course"] {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Ensure select options are readable */
.form-select option, select option {
    padding: 10px;
    white-space: normal;
    word-wrap: break-word;
}

.form-control:focus, .form-select:focus {
    border-color: #1B5E20;
    outline: none;
    box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.1);
}

input[type="file"] {
    padding: 10px;
    font-size: 0.9rem;
}

.btn-download {
    background: #FFD54F;
    color: #1B5E20;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: bold;
    border: none;
    transition: 0.3s;
    display: inline-block;
    text-decoration: none;
    font-size: 0.95rem;
}

.btn-download:hover {
    background: #ffca28;
    color: #1B5E20;
}

.btn-submit {
    background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 100%);
    color: #FFD54F;
    font-weight: bold;
    padding: 15px 30px;
    border: none;
    width: 100%;
    font-size: 1.1rem;
    border-radius: 50px;
    transition: all 0.4s ease;
    box-shadow: 0 10px 30px rgba(27, 94, 32, 0.4);
    margin-top: 20px;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #2E7D32 0%, #1B5E20 100%);
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(27, 94, 32, 0.5);
}

.requirements-box {
    background: linear-gradient(135deg, #FFF9E6 0%, #FFE082 100%);
    border: 2px solid #FFD54F;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 25px;
}

.requirements-box h5 {
    color: #1B5E20;
    font-weight: bold;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.requirements-box ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.requirements-box ul li {
    margin-bottom: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.success-message {
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
    color: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    animation: slideInDown 0.5s ease-out;
    font-size: 0.95rem;
}

.text-muted {
    font-size: 0.9rem;
}

/* Tablet styles */
@media (min-width: 576px) {
    .apply-form {
        padding: 30px;
    }

    .form-step {
        padding: 20px;
    }

    .requirements-box {
        padding: 20px;
    }

    .apply-header h2 {
        font-size: 2rem;
    }

    .apply-header p {
        font-size: 1.1rem;
    }

    .form-select, select {
        font-size: 1rem;
    }
}

/* Desktop styles */
@media (min-width: 768px) {
    .apply-wrapper {
        padding: 50px 0;
    }

    .apply-form {
        padding: 50px;
    }

    .form-step {
        padding: 30px;
        margin-bottom: 30px;
    }

    .form-label {
        font-size: 1.1rem;
    }

    .form-label i {
        font-size: 1.3rem;
        margin-right: 10px;
    }

    .requirements-box {
        padding: 25px;
        margin-bottom: 30px;
    }

    .requirements-box h5 {
        font-size: 1.2rem;
    }

    .requirements-box ul li {
        font-size: 1rem;
    }

    .apply-header {
        padding: 50px 40px;
    }

    .apply-header h2 {
        font-size: 2.5rem;
    }

    .apply-header p {
        font-size: 1.2rem;
    }

    .apply-icon {
        font-size: 4rem;
        margin-bottom: 20px;
    }

    .btn-submit {
        padding: 18px 50px;
        font-size: 1.3rem;
    }

    .btn-download {
        padding: 12px 25px;
        font-size: 1rem;
    }

    .success-message {
        padding: 20px;
        font-size: 1rem;
    }
}

/* Large desktop styles */
@media (min-width: 992px) {
    .apply-header::before {
        width: 400px;
        height: 400px;
    }
}

/* Mobile-specific adjustments */
@media (max-width: 575px) {
    body {
        padding-top: 70px;
    }

    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .form-step:hover {
        transform: none;
    }

    .btn-submit:hover {
        transform: none;
    }

    input[type="file"] {
        font-size: 0.85rem;
    }

    /* Enhanced mobile select styling */
    .form-select, select {
        font-size: 0.9rem !important;
        padding: 12px 35px 12px 12px !important;
        background-position: right 8px center !important;
        height: auto;
        min-height: 44px;
        max-width: 100% !important;
        width: 100% !important;
    }

    .form-control {
        max-width: 100% !important;
        width: 100% !important;
    }

    .form-step {
        padding: 12px;
        overflow: visible;
    }

    .form-select option, select option {
        font-size: 0.9rem;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .form-select, select {
        font-size: 0.85rem;
        padding: 10px 30px 10px 10px;
    }
}
