/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
    --neust-blue: #003366;
    --neust-yellow: #ffc107;
    --neust-light-blue: #0066cc;
    --neust-dark-blue: #001a33;
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --medium-gray: #dddddd;
    --dark-gray: #333333;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    position: relative;
}

body {
    background: linear-gradient(135deg, #003366 0%, #0066cc 100%);
    color: var(--dark-gray);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    box-sizing: border-box;
    overflow-x: hidden;
}

.login-body {
    background: linear-gradient(135deg, #003366 0%, #0066cc 100%);
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 20px;
    margin: 0;
    box-sizing: border-box;
}

.login-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/*.login-body::after {
    content: '';
    position: fixed;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 30%),
        radial-gradient(circle at 90% 80%, rgba(118, 75, 162, 0.2) 0%, transparent 40%);
    animation: gentleFloat 25s ease-in-out infinite reverse;
    pointer-events: none;
    z-index: 0;
}

@keyframes gentleFloat {
    0%, 100% { 
        transform: translate(0, 0) rotate(0deg);
        opacity: 1;
    }
    33% { 
        transform: translate(20px, -20px) rotate(1deg);
        opacity: 0.8;
    }
    66% { 
        transform: translate(-20px, 20px) rotate(-1deg);
        opacity: 0.9;
    }
} */

.login-container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    z-index: 10;
    animation: fadeInScale 0.6s ease-out forwards;
    overflow: visible;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}


.login-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.login-card {
    background: linear-gradient(white, white) padding-box,
                linear-gradient(90deg, #1565c0, #ffffff, var(--neust-yellow), #ffffff, #1565c0) border-box;
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 10px 30px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 1);
    overflow: hidden;
    border: 4px solid transparent;
    width: 80%;
    min-width: 320px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    background-size: 300% 300%;
    animation: borderFlow 6s ease infinite;
    margin: 20px auto;
}

@keyframes borderFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.login-card:hover {
    box-shadow: 
        0 25px 70px rgba(0, 0, 0, 0.35),
        0 15px 40px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 1);
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.5);
}

.login-header {
    /*background: linear-gradient(135deg, var(--neust-blue) 0%, var(--neust-light-blue) 100%);
    color: var(--white);*/
    background: var(--white);
    padding: 0px 10px 20px 10px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--neust-yellow) 0%, #ffd54f 50%, var(--neust-yellow) 100%);
    box-shadow: 0 2px 10px rgba(255, 193, 7, 0.5);
}

.login-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.login-header h1 {
    font-size: 1.6rem;
    margin-bottom: 6px;
    font-weight: 800;
    letter-spacing: 0.7px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.login-header h1 .intern {
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text; 
    display: inline-block;
}

.login-header h1 .link {
    background: linear-gradient(135deg, #fbc02d, #f57f17);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.login-header h4{
    font-size: 13px;
    font-weight: 500;
    opacity: 0.95;
    line-height: 1.4;
    margin: 0;
    color: var(--neust-dark-blue);
}

.login-form {
    background: var(--white);
    padding: 30px 35px 15px;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 2;
}

.form-title {
    color: var(--neust-blue);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.form-subtitle {
    color: #6b7280;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 25px;
    font-weight: 400;
}

.logo {
    width: 130px;
    height: auto;
    padding: 5px;
    /*margin-bottom: 12px;
    background: rgba(255, 255, 255);
    border-radius: 50%;
    border: 2px solid #ffc107;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);*/
}

.form-group {
    margin-bottom: 16px;
}

.form-group button {
    margin: 10px 0 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--neust-blue);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.form-group label::before {
    content: '👤';
    margin-right: 8px;
    font-size: 16px;
}

.form-group:nth-child(2) label::before {
    content: '🔒';
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--medium-gray);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #fafbfc;
    box-sizing: border-box;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper .form-control {
    padding-right: 15px;
    z-index: 5;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin: 0;
    border-radius: 6px;
    z-index: 5;
}

.toggle-password:hover {
    color: var(--neust-blue);
    background-color: rgba(0, 51, 102, 0.05);
}

.toggle-password:active {
    transform: scale(0.95);
}

.form-control:focus {
    border-color: var(--neust-blue);
    outline: none;
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.08);
}

.has-error .form-control {
    border-color: var(--danger);
}

.help-block {
    color: var(--danger);
    font-size: 12px;
    margin-top: 5px;
}

h2 {
    color: #001f3f; 
    margin-bottom: 1rem;
    font-weight: 700;
}

/* Login page uses .form-group label for labels */

/* Login page uses .form-control class for inputs */

button {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    padding: 12px 24px;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: none;
    font-size: 15px;
    text-transform: capitalize;
    margin-top: 15px;
    letter-spacing: 0.5px;
}

.button-primary {
    background: linear-gradient(135deg, var(--neust-blue) 0%, var(--neust-light-blue) 100%) !important;
    color: var(--white) !important;
    border: none !important;
    font-weight: 700 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.25) !important;
    padding: 12px 24px !important;
}

.button-primary:hover {
    background: linear-gradient(135deg, var(--neust-light-blue) 0%, var(--neust-blue) 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0, 51, 102, 0.35) !important;
}

.button-primary:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(0, 51, 102, 0.25) !important;
}

.button-block {
    display: block;
    width: 100%;
}

/* Removed conflicting button:hover rule - handled by specific button classes */

.button-success {
    background-color: #4CAF50; /* Green */
    color: white;
}

.button-danger {
    background-color: #f44336; /* Red */
    color: white;
}

.button-success:hover {
    background-color: #45a049;
}

.button-danger:hover {
    background-color: #e53935;
}

footer {
    padding-top: 25px;
    text-align: center;
    font-size: 12px;
    color: var(--neust-dark-blue);
}

.error-message {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--danger, #dc3545);
    color: var(--white, #ffffff);
    padding: 12px 15px;
    border-radius: 6px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
    text-align: center;
    position: relative;
    animation: fadeIn 0.3s ease-in-out;
}

/* Icon */
.error-message::before {
    content: "⚠️";
    font-size: 1.2rem;
    margin-right: 10px;
}

/* Fade-In Effect */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.role-label {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
    color: #333;
}

.select-role {
    width: 100px; 
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    background-color: white;
    color: #050000;
    cursor: pointer;
}

/* ===== Responsive Styles ===== */


/* Responsive scaling */
@media (max-width: 480px) {
    .login-container {
        width: 95%;
        padding: 15px;
        transform: translate(-50%, -50%) scale(1);
    }
    
    .login-card {
        width: 100%;
        max-width: 100%;
        border-radius: 16px;
    }
}

/* For very small devices */
@media (max-width: 360px) {
    .login-container {
        width: 100%;
        padding: 10px;
        transform: translate(-50%, -50%) scale(0.95);
    }
    
    .login-card {
        border-radius: 14px;
    }
}

/* For larger screens */
@media (min-width: 1600px) {
    .login-container {
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Small devices (phones, 480px and down) */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .login-container {
        padding: 10px;
        margin: 0;
    }
    
    .login-header {
        padding: 20px 15px 15px;
    }
    
    .login-header h1 {
        font-size: 1.8rem;
        margin-bottom: 5px;
    }
    
    .login-header h4 {
        font-size: 14px;
        line-height: 1.3;
    }
    
    .login-form {
        padding: 20px 15px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-control {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    button {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Tablets and small desktops (481px to 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .login-container {
        max-width: 90%;
        margin: 20px auto;
    }
    
    .login-header h1 {
        font-size: 2rem;
    }
}

/* Large desktops (1200px and up) */
@media (min-width: 1200px) {
    .login-container {
        max-width: 500px;
    }
}

/* Landscape mode on mobile devices */
@media (max-height: 600px) and (orientation: landscape) {
    .login-body {
        padding: 10px 0;
    }
    
    .login-container {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Remove any transforms that might interfere with scrolling */
    input:focus, textarea:focus, select:focus {
        transform: none;
    }
    
    /* Ensure inputs are large enough for touch */
    .form-control {
        min-height: 44px; /* Minimum touch target size */
    }
    
    /* Allow scrolling when keyboard is shown */
    body {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
        position: relative;
        height: 100%;
        width: 100%;
    }
    
    /* Ensure the login container is scrollable */
    .login-container {
        -webkit-overflow-scrolling: touch;
        /*overflow-y: auto;*/
        max-height: 100vh;
        padding-bottom: 100px; /* Extra space for keyboard */
    }
    
    button, .button-primary {
        min-height: 44px; /* Minimum touch target size */
    }
}
