/* ===== Base Styles ===== */
body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f0f0f5 0%, #d9d9ff 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

/* Wrapper */
.container-wrapper {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
}

.login-container {
    width: 800px;
    background: transparent;
    padding: 30px 30px 10px;
    border-radius: 16px;
    box-shadow: 0 15px 30px rgba(102, 51, 153, 0.2);
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.credentials-container {
    width: 500px;
    background: transparent;
    padding: 30px 30px 50px;
    border-radius: 16px;
    box-shadow: 0 15px 30px rgba(102, 51, 153, 0.2);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Headers */
.login-container h1,
.credentials-container h1 {
    color: #000000;
    font-size: 30px;
    margin-bottom: 6px;
    font-weight: 800;
    text-align: center;
}
.login-container p.subtitle,
.credentials-container p.subtitle {
    color: #000000;
    margin-bottom: 25px;
    font-size: 15px;
    text-align: center;
}

/* ===== Form ===== */
form {
    z-index: 3;
    position: relative;
}
.input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}
.input-group {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.input-group.wide {
    flex: 2;
}
.input-group.small {
    max-width: 120px;
    flex: 0 0 auto;
}

/* Labels */
label {
    font-weight: 600;
    margin-bottom: 4px;
    color: #3b0066;
    font-size: 14px;
}

/* Error / Valid */
input.error,
select.error {
    border: 2px solid #dc2626; /* red-600 */
}
input.valid,
select.valid {
    border: 2px solid #16a34a; /* green-600 */
}
.error-message {
    color: red;
    font-size: 12px;
    margin-top: 3px;
    display: block;
    white-space: nowrap;
}

/* Inputs + Selects */
input,
select {
    padding: 10px 12px;
    border: 1px solid #000000;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    height: 42px;
    background-color: #fff;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s ease;
}
input:focus,
select:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.25);
}

/* Placeholder */
input::placeholder {
    color: #000000;
    font-size: 14px;
    opacity: 1;
}
select:invalid {
    color: #9ca3af;
}
select option {
    color: #111;
}

/* File Inputs */
input[type="file"] {
    border: 1px solid #999;
    border-radius: 8px;
    padding: 6px;
    height: 42px;
    font-size: 14px;
    color: #3b0066;
}
input[type="file"]::file-selector-button {
    background: #7c3aed;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    margin-right: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
input[type="file"]::file-selector-button:hover {
    background: #5b21b6;
}

/* Submit Button */
.login-btn {
    padding: 12px 20px;
    font-weight: 700;
    font-size: 14px;
    margin-top: 10px;
    background: linear-gradient(90deg, #4b2b8d 0%, #230061 100%);
    color: white;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 10px 20px #5132a6cc;
    transition: background 0.3s ease;
    height: 42px;
}
.login-btn:hover {
    background: linear-gradient(90deg, #5b21b6 0%, #3b0066 100%);
}

/* ===== Decorative Elements ===== */
.decorative-wave-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 180px;
    z-index: 0;
    overflow: hidden;
}
svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100%;
}
.wave1 {
    animation: waveMove 10s linear infinite;
}
.wave2 {
    animation: waveMove 14s linear infinite;
}
.wave3 {
    animation: waveMove 20s linear infinite;
}
.wave4 {
    animation: waveMove 25s linear infinite;
}
.wave5 {
    animation: waveMove 30s linear infinite;
}
@keyframes waveMove {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Floating Circles */
.floating-circles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}
.circle {
    position: absolute;
    width: 25px;
    height: 25px;
    background: rgba(109, 83, 211, 0.25);
    border-radius: 50%;
    animation: floatUp 12s infinite ease-in-out;
}
.circle.small {
    width: 15px;
    height: 15px;
    background: rgba(140, 112, 247, 0.3);
    animation-duration: 15s;
}
.square1 {
    width: 14px;
    height: 14px;
    right: 40px;
    top: 80%;
    border-radius: 4px;
    background: rgba(109, 83, 211, 0.3);
    box-shadow: 0 0 6px rgba(109, 83, 211, 0.5);
}

/* Page Header */
.page-header {
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
    margin-top: -40px;
}
.page-header .logo {
    width: 80px;
    height: auto;
    display: block;
    margin: 0 auto 10px;
}
.page-header .title {
    font-size: 32px;
    font-weight: 900;
    color: #3b0066;
    margin: 0;
}
.footer-text {
    margin-top: 5px;
    text-align: center;
    font-size: 17px;
    font-weight: 500;
    color: #555;
}
.banner-grad {
    background: #7c3aed; /* solid light purple */
    height: 100px;
    clip-path: polygon(0 0, 100% 0, 100% 40%, 55% 45%, 50% 100%, 0 100%);
    position: relative;
}

/* Back button */
.back-btn {
    background: transparent;
    border: none;
    margin-right: 20px;
    font-size: 28px;
    color: rgb(0, 0, 0);
    font-size: 50px;
    cursor: pointer;
}

/* ===== Mobile Responsiveness ===== */

/* Tablet and smaller screens */
@media (max-width: 768px) {
    body {
        overflow: auto; /* Allow scrolling on mobile */
        height: auto; /* Remove fixed height */
        padding: 10px;
    }

    .container-wrapper {
        flex-direction: column;
        gap: 15px;
        width: 100%;
        max-width: 100%;
    }

    .login-container {
        width: 100%;
        padding: 20px 15px;
    }

    .credentials-container {
        width: 100%;
        padding: 20px 15px;
    }

    .login-container h1,
    .credentials-container h1 {
        font-size: 24px;
    }

    .login-container p.subtitle,
    .credentials-container p.subtitle {
        font-size: 14px;
    }

    .input-row {
        gap: 15px;
    }

    .login-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 16px;
    }

    .banner-grad {
        height: 80px;
        clip-path: none; /* Remove clip-path to avoid cutting the banner on mobile */
    }

    .banner-grad .text-2xl {
        font-size: 1.25rem;
    }

    .banner-grad .text-xs {
        font-size: 0.75rem;
    }

    .back-btn {
        font-size: 40px;
        margin-right: 10px;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    .container-wrapper {
        gap: 10px;
    }

    .login-container,
    .credentials-container {
        padding: 15px 10px;
        border-radius: 12px;
    }

    .login-container h1,
    .credentials-container h1 {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .login-container p.subtitle,
    .credentials-container p.subtitle {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .input-row {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 12px;
    }

    .input-group {
        width: 100%;
    }

    .input-group[style*="width: 10px"] {
        width: 100% !important;
    }

    label {
        font-size: 13px;
    }

    input,
    select {
        padding: 8px 10px;
        font-size: 13px;
        height: 38px;
    }

    input[type="file"] {
        padding: 4px;
        height: 38px;
        font-size: 13px;
    }

    input[type="file"]::file-selector-button {
        padding: 4px 8px;
        font-size: 12px;
    }

    .login-btn {
        padding: 12px 16px;
        font-size: 15px;
        height: 40px;
    }

    .banner-grad {
        height: 70px;
        padding: 8px;
        clip-path: none; /* Remove clip-path to avoid cutting the banner on mobile */
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .banner-grad .flex.items-center {
        flex-direction: column;
        gap: 4px;
    }

    .banner-grad img {
        height: 32px;
        margin: 0;
    }

    .banner-grad .text-2xl {
        font-size: 1rem;
        line-height: 1.2;
    }

    .banner-grad .text-xs {
        font-size: 0.625rem;
        line-height: 1.1;
    }

    .back-btn {
        font-size: 35px;
        margin-right: 5px;
    }

    .error-message {
        font-size: 11px;
    }
}
