/* ===== CSS Variables ===== */
:root {
    --primary-dark: #1a3e6f;
    --primary: #3498db;
    --primary-light: #2980b9;
    --secondary-dark: #2c3e50;
    --success: #27ae60;
    --success-dark: #229954;
    --gray-light: #f9fbfd;
    --gray-border: #d1d9e6;
    --text-dark: #2c3e50;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 6px 12px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

/* ===== Global Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ecf0f1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

/* ===== Main Container ===== */
.login-container {
    display: flex;
    width: 1200px;
    max-width: 100%;
    min-height: 600px;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* ===== Left Side ===== */
.left-side {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.logo-container {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    max-width: calc(100% - 40px);
}

.logo-img {
    height: 40px;
    width: auto;
    flex-shrink: 0;
}

.school-name {
    color: var(--primary-dark);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    word-break: break-word;
}

.overlay-text {
    position: absolute;
    bottom: 290px;
    left: 20px;
    right: 20px;
    background: linear-gradient(135deg, rgba(26, 62, 111, 0.98), rgba(52, 152, 219, 0.98));
    color: white;
    padding: 25px;
    border-radius: 15px;
    backdrop-filter: blur(5px);
    z-index: 2;
    box-shadow: var(--shadow-sm);
}

.overlay-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
}

.overlay-text h1::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 40px;
    height: 3px;
    background: white;
    border-radius: 3px;
}

.overlay-text p {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 15px;
    opacity: 0.95;
}

/* ===== Right Side ===== */
.right-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: white;
}

.login-form {
    width: 100%;
    max-width: 400px;
}

.login-form h2 {
    color: var(--primary-dark);
    font-size: 2em;
    font-weight: 600;
    margin-bottom: 30px;
    position: relative;
    padding-left: 15px;
}

.login-form h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 40px;
    background: linear-gradient(to bottom, var(--primary-dark), var(--primary));
    border-radius: 3px;
}

/* ===== Form Elements ===== */
.login-form label {
    display: block;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 5px;
    font-size: 0.95em;
}

.login-form input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 20px;
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    font-size: 1em;
    transition: var(--transition);
    background-color: var(--gray-light);
    -webkit-appearance: none;
    appearance: none;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background-color: white;
}

/* ===== Buttons ===== */
.btn-login,
.btn-google {
    width: 100%;
    padding: 14px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
    display: inline-block;
    text-align: center;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-login {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    margin-top: 10px;
}

.btn-login:hover {
    background: linear-gradient(135deg, var(--primary-light), #1a6a9f);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(52, 152, 219, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-google {
    background: linear-gradient(135deg, var(--success), var(--success-dark));
    color: white;
}

.btn-google:hover {
    background: linear-gradient(135deg, var(--success-dark), #1e8449);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(39, 174, 96, 0.3);
}

.btn-google:active {
    transform: translateY(0);
}

/* ===== Divider ===== */
.divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
    color: #7f8c8d;
    font-weight: 500;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: var(--gray-border);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

/* ===== Info Text ===== */
.info-text {
    margin-top: 20px;
    font-size: 0.9em;
    color: #7f8c8d;
    text-align: center;
    line-height: 1.5;
    padding: 0 10px;
}

/* ===== Tablet Responsive (768px - 1024px) ===== */
@media (max-width: 1024px) {
    .login-container {
        max-width: 95%;
    }

    .overlay-text {
        bottom: 30px;
        padding: 20px;
    }

    .overlay-text h1 {
        font-size: 1.3rem;
    }

    .overlay-text p {
        font-size: 0.85rem;
    }
}

/* ===== Mobile Responsive (up to 768px) ===== */
@media (max-width: 768px) {
    body {
        padding: 0;
        background: white;
        align-items: flex-start;
    }

    .login-container {
        flex-direction: column;
        max-width: 100%;
        min-height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }

    .left-side {
        min-height: 350px;
        max-height: 400px;
    }

    .logo-container {
        top: 15px;
        left: 15px;
        right: 15px;
        padding: 8px 15px;
        gap: 10px;
        max-width: calc(100% - 30px);
    }

    .logo-img {
        height: 35px;
    }

    .school-name {
        font-size: 0.9rem;
    }

    .overlay-text {
        bottom: 20px;
        left: 15px;
        right: 15px;
        padding: 18px;
    }

    .overlay-text h1 {
        font-size: 1.2rem;
        margin-bottom: 5px;
    }

    .overlay-text h1::after {
        width: 30px;
        height: 2px;
    }

    .overlay-text p {
        font-size: 0.8rem;
        line-height: 1.4;
        margin-bottom: 10px;
    }

    .right-side {
        padding: 30px 20px 40px;
    }

    .login-form h2 {
        font-size: 1.6rem;
        margin-bottom: 25px;
        padding-left: 12px;
    }

    .login-form h2::before {
        width: 4px;
        height: 35px;
    }

    .login-form input {
        padding: 14px 15px;
        font-size: 16px;
        /* Prevents zoom on iOS */
        margin-bottom: 18px;
    }

    .btn-login,
    .btn-google {
        padding: 16px 25px;
        font-size: 1rem;
    }

    .info-text {
        font-size: 0.85rem;
        padding: 0 5px;
    }
}

/* ===== Small Mobile (up to 480px) ===== */
@media (max-width: 480px) {
    .left-side {
        min-height: 300px;
        max-height: 350px;
    }

    .logo-container {
        padding: 6px 12px;
    }

    .logo-img {
        height: 30px;
    }

    .school-name {
        font-size: 0.8rem;
    }

    .overlay-text {
        padding: 15px;
    }

    .overlay-text h1 {
        font-size: 1.1rem;
    }

    .overlay-text p {
        font-size: 0.75rem;
        line-height: 1.3;
    }

    .right-side {
        padding: 25px 15px 35px;
    }

    .login-form h2 {
        font-size: 1.4rem;
        margin-bottom: 20px;
        padding-left: 10px;
    }

    .login-form h2::before {
        height: 30px;
    }

    .login-form label {
        font-size: 0.9rem;
    }

    .login-form input {
        padding: 12px 12px;
        font-size: 15px;
    }

    .btn-login,
    .btn-google {
        padding: 14px 20px;
        font-size: 0.95rem;
    }

    .divider {
        margin: 15px 0;
        font-size: 0.9rem;
    }
}

/* ===== Landscape Mode on Mobile ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .left-side {
        min-height: 250px;
        max-height: 280px;
    }

    .overlay-text {
        bottom: 15px;
        padding: 12px;
    }

    .overlay-text p {
        margin-bottom: 5px;
    }

    .overlay-text p:last-child {
        margin-bottom: 0;
    }

    .right-side {
        padding: 20px;
    }

    .login-form {
        max-width: 500px;
    }
}

/* ===== Touch-friendly improvements ===== */
@media (hover: none) and (pointer: coarse) {

    .btn-login:hover,
    .btn-google:hover {
        transform: none;
    }

    .btn-login:active,
    .btn-google:active {
        transform: scale(0.98);
    }

    input,
    button,
    .btn-google {
        cursor: default;
    }
}