﻿/* Reset for no scroll */
body, html {
    height: 100vh;
    /*overflow: hidden;*/
    margin: 0;
    padding: 0;
    background: #f5f7fa;
    background: linear-gradient(135deg, #f0f7f4 0%, #d6ece2 100%);
}

.login-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

/* REDUCED HEIGHT: Made container and card smaller */
.login-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    /*min-height: 520px;*/ /* Reduced from 580px */
}

.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    min-height: 500px; /* Reduced from 560px */
    display: flex;
    flex-direction: column;
}

/* Smaller header */
.card-header {
    padding: 10px 12px 10px; /* Reduced padding */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: linear-gradient(135deg, #ffffff 0%, #f0f7f4 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
    flex-shrink: 0; /* Prevent shrinking */
}

/* ✅ CENTER ALIGNED - matching doc 5 */
.brand-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.brand-logo {
    height: 45px; /* Smaller logo */
    width: auto;
    max-width: 160px;
    object-fit: contain;
}

/* ✅ CENTER ALIGNED - matching doc 5 */
.brand-info {
    flex: 1;
    text-align: center;
}

.brand-title {
    margin: 0 0 0px 0; /* Reduced margin */
    font-size: 15px; /* Smaller font */
    color: #0C4930;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.brand-subtitle {
    margin: 0;
    font-size: 13px; /* Smaller font */
    color: #64748b;
    line-height: 1.4;
    font-weight: 500;
}

.portal-badge {
    background: linear-gradient(135deg, #0C4930 0%, #072b1c 100%);
    color: white;
    padding: 8px 16px; /* Smaller padding */
    border-radius: 8px;
    font-size: 14px; /* Smaller font */
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(12, 73, 48, 0.2);
}

    .portal-badge i {
        font-size: 13px;
    }

/* Smaller content area */
.card-content {
    display: flex;
    flex: 1;
    /*min-height: 420px;*/ /* Reduced from 480px */
}

.institute-info {
    flex: 1;
    background: linear-gradient(135deg, #0C4930 0%, #072b1c 100%);
    color: white;
    padding: 30px 25px; /* Reduced padding */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

    .institute-info::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none" opacity="0.05"><path d="M0,0 L100,0 L100,100 Z" fill="white"/></svg>');
        background-size: cover;
        pointer-events: none;
    }

    /* Smaller logo container */
    .institute-info .institute-logo {
        width: 90px; /* Reduced from 100px */
        height: 90px; /* Reduced from 100px */
        background: rgba(255, 255, 255, 0.12);
        margin-bottom: 20px; /* Reduced margin */
        display: flex;
        align-items: center;
        justify-content: center;
        border: 3px solid rgba(255, 255, 255, 0.25);
        overflow: hidden;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
        position: relative;
        z-index: 1;
    }

        .institute-info .institute-logo img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            display: block;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }

/* Dynamic shape classes */
.institute-logo.circle-shape {
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.08) 70%);
}

    .institute-logo.circle-shape img {
        border-radius: 50%;
        padding: 0;
        object-fit: cover;
    }

.institute-logo.rounded-square-shape {
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.08) 100%);
}

    .institute-logo.rounded-square-shape img {
        border-radius: 20px;
        padding: 10px; /* Reduced padding */
        object-fit: contain;
    }

.institute-logo.square-shape {
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
}

    .institute-logo.square-shape img {
        border-radius: 12px;
        padding: 12px; /* Reduced padding */
        object-fit: contain;
    }

.institute-logo.pill-shape {
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.08) 100%);
}

    .institute-logo.pill-shape img {
        border-radius: 48px;
        padding: 8px 16px; /* Reduced padding */
        object-fit: contain;
        max-width: 92%;
        max-height: 92%;
    }

.institute-info h2 {
    margin: 0 0 12px 0; /* Reduced margin */
    font-size: 20px; /* Smaller font */
    font-weight: 800;
    line-height: 1.2;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.institute-info .institute-details {
    margin: 15px 0 0 0; /* Reduced margin */
    font-size: 13px; /* Smaller font */
    line-height: 1.6;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

    .institute-info .institute-details p {
        margin: 6px 0; /* Reduced margin */
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px; /* Reduced gap */
    }

    .institute-info .institute-details i {
        opacity: 0.9;
        font-size: 13px; /* Smaller icon */
    }

/* Smaller form section */
.login-form-section {
    flex: 1;
    padding: 30px 30px; /* Reduced padding */
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
    min-height: 420px; /* Reduced height */
}

    .login-form-section .form-header {
        margin-bottom: 25px; /* Reduced margin */
        text-align: center;
    }

        .login-form-section .form-header h3 {
            margin: 0 0 8px 0; /* Reduced margin */
            color: #0C4930;
            font-size: 18px; /* Smaller font */
            font-weight: 800;
        }

        .login-form-section .form-header p {
            margin: 0;
            color: #64748b;
            font-size: 13px; /* Smaller font */
            font-weight: 500;
        }

.login-form {
    margin-bottom: 20px; /* Reduced margin */
}

.form-group {
    margin-bottom: 20px; /* Reduced margin */
}

.form-label {
    display: block;
    margin-bottom: 8px; /* Reduced margin */
    font-weight: 700;
    color: #334155;
    font-size: 13px; /* Smaller font */
    display: flex;
    align-items: center;
    gap: 8px; /* Reduced gap */
}

    .form-label i {
        color: #0C4930;
        font-size: 14px; /* Smaller icon */
        width: 16px; /* Reduced width */
        text-align: center;
    }

.input-with-icon {
    position: relative;
}

    .input-with-icon .form-control {
        width: 100%;
        height: 48px; /* Reduced height */
        padding: 12px 16px 12px 42px; /* Reduced padding */
        font-size: 14px; /* Smaller font */
        border: 2px solid #e2e8f0;
        border-radius: 10px;
        transition: all 0.2s ease;
        box-sizing: border-box;
        background: #f8fafc;
        font-weight: 500;
    }

        .input-with-icon .form-control:focus {
            border-color: #0C4930;
            box-shadow: 0 0 0 4px rgba(12, 73, 48, 0.15);
            outline: none;
            background: white;
            transform: translateY(-1px);
        }

        .input-with-icon .form-control::placeholder {
            color: #94a3b8;
            font-size: 13px; /* Smaller placeholder */
            font-weight: 400;
        }

    .input-with-icon .input-icon {
        position: absolute;
        left: 16px; /* Adjusted position */
        top: 50%;
        transform: translateY(-50%);
        color: #64748b;
        font-size: 16px; /* Smaller icon */
        pointer-events: none;
    }

.text-danger {
    color: #dc3545;
    font-size: 12px; /* Smaller font */
    margin-top: 5px; /* Reduced margin */
    display: block;
    font-weight: 500;
}

.validation-summary-errors {
    background: linear-gradient(135deg, #fee 0%, #fdd 100%);
    border: 2px solid #fcc;
    border-radius: 10px;
    padding: 12px 16px; /* Reduced padding */
    margin-bottom: 20px; /* Reduced margin */
    color: #c33;
    font-size: 13px; /* Smaller font */
    line-height: 1.4;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.1);
}

    .validation-summary-errors ul {
        margin: 0;
        padding-left: 16px; /* Reduced padding */
    }

    .validation-summary-errors li {
        margin-bottom: 4px; /* Reduced margin */
    }

        .validation-summary-errors li:last-child {
            margin-bottom: 0;
        }

.login-button {
    width: 100%;
    height: 48px; /* Reduced height */
    background: linear-gradient(135deg, #0C4930 0%, #072b1c 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 15px; /* Smaller font */
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 12px; /* Reduced margin */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px; /* Reduced gap */
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

    .login-button:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(12, 73, 48, 0.35);
    }

    .login-button:active {
        transform: translateY(-1px);
    }

    .login-button i {
        font-size: 16px; /* Smaller icon */
    }

.forgot-password-link {
    text-align: center;
    margin-top: 20px; /* Reduced margin */
    padding-top: 20px; /* Reduced padding */
    border-top: 2px solid #d6ece2;
}

    .forgot-password-link a {
        color: #0C4930;
        text-decoration: none;
        font-size: 13px; /* Smaller font */
        display: inline-flex;
        align-items: center;
        transition: all 0.2s ease;
        font-weight: 700;
        padding: 8px 16px; /* Reduced padding */
        border-radius: 8px;
        gap: 8px; /* Reduced gap */
        background: rgba(12, 73, 48, 0.05);
    }

        .forgot-password-link a:hover {
            color: #072b1c;
            background: rgba(12, 73, 48, 0.1);
            text-decoration: none;
            transform: translateY(-1px);
        }

        .forgot-password-link a i {
            font-size: 12px; /* Smaller icon */
        }

/* Responsive adjustments */
@media (max-width: 992px) {
    .login-container {
        max-width: 800px;
    }

    .card-header {
        padding: 20px 25px 15px; /* Reduced padding */
        flex-direction: column;
        text-align: center;
        gap: 15px; /* Reduced gap */
    }

    .brand-section {
        text-align: center;
        gap: 12px;
    }

    .portal-badge {
        align-self: center;
    }
}

@media (max-width: 768px) {
    .login-wrapper {
        padding: 15px;
    }

    .login-container {
        max-width: 500px;
        min-height: auto;
    }

    .login-card {
        min-height: auto;
    }

    .card-content {
        flex-direction: column;
        min-height: auto;
    }

    .card-header {
        padding: 15px 20px 12px; /* Reduced padding */
    }

    .institute-info {
        padding: 25px 20px; /* Reduced padding */
        border-radius: 16px 16px 0 0;
    }

    .login-form-section {
        padding: 25px 20px; /* Reduced padding */
        min-height: auto;
    }

    .brand-logo {
        height: 40px; /* Smaller logo */
    }

    .brand-title {
        font-size: 18px; /* Smaller font */
    }

    .brand-subtitle {
        font-size: 12px; /* Smaller font */
    }

    .institute-info .institute-logo {
        width: 80px; /* Smaller logo */
        height: 80px; /* Smaller logo */
    }

    .institute-info h2 {
        font-size: 18px; /* Smaller font */
    }
}

@media (max-height: 800px) {
    .login-wrapper {
        padding-top: 15px;
        padding-bottom: 15px;
    }

    .login-container {
        min-height: 480px; /* Further reduced */
    }

    .login-card {
        min-height: 460px; /* Further reduced */
    }

    .card-content {
        min-height: 380px; /* Further reduced */
    }
}

@media (max-height: 700px) {
    .login-wrapper {
        justify-content: flex-start;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .card-header {
        padding: 15px 20px 12px; /* Further reduced */
    }

    .brand-logo {
        height: 35px; /* Further reduced */
    }

    .brand-title {
        font-size: 16px; /* Further reduced */
    }

    .brand-subtitle {
        font-size: 11px; /* Further reduced */
    }

    .institute-info {
        padding: 20px 15px; /* Further reduced */
    }

        .institute-info .institute-logo {
            width: 70px; /* Further reduced */
            height: 70px; /* Further reduced */
            margin-bottom: 15px; /* Further reduced */
        }

        .institute-info h2 {
            font-size: 16px; /* Further reduced */
        }

        .institute-info .institute-details {
            font-size: 12px; /* Further reduced */
        }

    .login-form-section {
        padding: 20px 15px; /* Further reduced */
    }

    .form-group {
        margin-bottom: 15px; /* Further reduced */
    }

    .input-with-icon .form-control {
        height: 44px; /* Further reduced */
        font-size: 13px; /* Further reduced */
    }

    .login-button {
        height: 44px; /* Further reduced */
        font-size: 14px; /* Further reduced */
    }
}

@media (max-height: 600px) {
    .login-wrapper {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .login-card {
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .card-content {
        min-height: auto;
    }

    .forgot-password-link {
        margin-top: 15px; /* Further reduced */
        padding-top: 15px; /* Further reduced */
    }
}

/* Ensure Forgot Password is always visible on mobile */
@media (max-width: 768px) {
    .forgot-password-link {
        margin-top: 15px;
        padding-top: 15px;
    }

        .forgot-password-link a {
            font-size: 12px;
            padding: 6px 12px;
        }
}

/* For very small screens */
@media (max-width: 480px) {
    .forgot-password-link a {
        font-size: 11px;
        padding: 5px 10px;
    }

    .brand-logo {
        height: 35px;
    }

    .brand-title {
        font-size: 16px;
    }

    .brand-subtitle {
        font-size: 11px;
    }

    .portal-badge {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* For very short screens (landscape mode) */
@media (max-height: 600px) and (max-width: 768px) {
    .forgot-password-link {
        position: static !important;
        margin-top: 15px !important;
    }

    .login-form-section {
        padding-bottom: 20px !important;
    }
}

/* Animation for card entrance */
.login-card {
    animation: cardEntrance 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Custom scrollbar for login card */
.login-card::-webkit-scrollbar {
    width: 6px; /* Thinner scrollbar */
}

.login-card::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.login-card::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

    .login-card::-webkit-scrollbar-thumb:hover {
        background: #a1a1a1;
    }
