/* Modern Responsive Login Page - Professional Design */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-color: #667eea;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --white: #ffffff;
    --light-bg: #f7fafc;
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.2);
}

body.login {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

/* Animated Background Elements */
body.login::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.6) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.4) 0%, transparent 50%);
    animation: float 25s linear infinite;
    pointer-events: none;
    z-index: 0;
}

body.login::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 50%, rgba(102, 126, 234, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(118, 75, 162, 0.05) 0%, transparent 50%);
    animation: pulse 10s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}


@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(100px, 100px) rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

/* Logo Section - Inside Content Card */
.login .content .logo {
    margin: 0 auto 30px;
    text-align: center;
    animation: fadeInDown 0.8s ease-out;
    z-index: 10;
    position: relative;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.login .content .logo a {
    display: inline-block;
    text-decoration: none;
    line-height: 0;
}

.login .content .logo img {
    width: 200px;
    max-width: 90%;
    height: auto;
    display: block !important;
    margin: 0 auto;
    visibility: visible !important;
    opacity: 1 !important;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s ease;
    animation: logoFloat 4s ease-in-out infinite;
}

.login .content .logo img:hover {
    transform: scale(1.05);
}

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

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

/* Login Card */
.login .content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 28px;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: 50px 45px;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.8s ease-out 0.2s both;
    z-index: 10;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login .content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--primary-gradient);
    background-size: 200% 100%;
    animation: shimmer 4s linear infinite;
}

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

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Form Title */
.login .content .form-title {
    font-size: 34px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeIn 0.8s ease-out 0.4s both;
    letter-spacing: -0.5px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Form Groups */
.login .content .form-group {
    margin-bottom: 24px;
    position: relative;
    animation: fadeInUp 0.6s ease-out both;
}

.login .content .form-group:nth-child(1) { animation-delay: 0.5s; }
.login .content .form-group:nth-child(2) { animation-delay: 0.6s; }
.login .content .form-group:nth-child(3) { animation-delay: 0.7s; }
.login .content .form-group:nth-child(4) { animation-delay: 0.8s; }

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

/* Modern Input Fields */
.login .content .form-control {
    width: 100%;
    height: 58px;
    padding: 0 20px 0 60px;
    border: 2px solid var(--border-color);
    border-radius: 14px;
    font-size: 15px;
    font-weight: 400;
    color: var(--text-primary);
    background: var(--light-bg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.login .content .form-control::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
}

.login .content .form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--white);
    box-shadow: 
        0 0 0 4px rgba(102, 126, 234, 0.1),
        var(--shadow-md);
    transform: translateY(-2px);
}

.login .content .form-control:not(:placeholder-shown) {
    background: var(--white);
    border-color: #cbd5e0;
}

/* Input Icons */
.login .content .form-group::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    z-index: 2;
    pointer-events: none;
    opacity: 0.5;
    transition: opacity 0.3s ease;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.login .content .form-group:has(input[type="text"])::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23667eea'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z'/%3E%3C/svg%3E");
}

.login .content .form-group:has(input[type="password"])::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23667eea'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z'/%3E%3E%3C/svg%3E");
}

.login .content .form-group:has(select)::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23667eea'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4'/%3E%3E%3C/svg%3E");
}

.login .content .form-group:focus-within::before {
    opacity: 1;
}

/* Select Styling */
.login .content select.form-control {
    padding-left: 60px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%23667eea' d='M7 10L2 5h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    cursor: pointer;
    background-color: var(--light-bg);
}

.login .content select.form-control:focus {
    background-color: var(--white);
}

/* Modern Button */
.login .content .btn {
    width: 100%;
    height: 58px;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 10px;
    animation: fadeInUp 0.6s ease-out 0.9s both;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.login .content .btn.green {
    background: var(--primary-gradient);
    color: var(--white);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.login .content .btn.green::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.login .content .btn.green:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

.login .content .btn.green:hover::before {
    left: 100%;
}

.login .content .btn.green:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.login .content .btn.yellow {
    background: var(--secondary-gradient);
    color: var(--white);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
    margin-top: 15px;
}

.login .content .btn.yellow:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(245, 87, 108, 0.5);
}

/* Alert Messages */
.login .content .alert {
    padding: 16px 20px;
    border-radius: 14px;
    margin-bottom: 24px;
    border: none;
    animation: shake 0.5s ease-in-out;
    box-shadow: var(--shadow-md);
    font-weight: 500;
}

.login .content .alert-danger {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: var(--white);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Code Field Animation */
.login .content .form-group.code {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0;
}

.login .content .form-group.code:not(.hide) {
    max-height: 120px;
    opacity: 1;
    margin-bottom: 24px;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Copyright - Inside Content Card */
.login .content .copyright {
    text-align: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 400;
    z-index: 10;
    position: relative;
    animation: fadeIn 1s ease-out 1s both;
    line-height: 1.8;
}

.login .content .copyright a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.login .content .copyright a:hover {
    color: var(--primary-gradient);
    text-decoration: underline;
}

/* Hide copyright if it's outside content (old structure) */
body.login > .copyright {
    display: none;
}

/* Loading State */
.login .content .btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.login .content .btn.loading::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    top: 50%;
    left: 50%;
    margin-left: -11px;
    margin-top: -11px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design - Tablet */
@media (max-width: 768px) {
    body.login {
        padding: 15px;
    }
    
    .login .content .logo {
        margin-bottom: 25px;
        padding-bottom: 18px;
    }
    
    .login .content .logo img {
        width: 180px;
    }
    
    .login .content .copyright {
        margin-top: 25px;
        padding-top: 20px;
        font-size: 11px;
    }
    
    .login .content {
        padding: 40px 35px;
        border-radius: 24px;
        max-width: 100%;
    }
    
    .login .content .form-title {
        font-size: 30px;
        margin-bottom: 35px;
    }
    
    .login .content .form-group {
        margin-bottom: 20px;
    }
    
    .login .content .form-control {
        height: 54px;
        padding: 0 18px 0 56px;
        font-size: 15px;
    }
    
    .login .content .form-group::before {
        left: 18px;
        width: 20px;
        height: 20px;
    }
    
    .login .content select.form-control {
        padding-left: 56px;
    }
    
    .login .content .btn {
        height: 54px;
        font-size: 15px;
    }
    
    .login .copyright {
        font-size: 12px;
        margin-top: 30px;
    }
}

/* Responsive Design - Mobile */
@media (max-width: 480px) {
    body.login {
        padding: 10px;
        min-height: 100vh;
    }
    
    .login .logo {
        margin-top: 10px;
        margin-bottom: 20px;
    }
    
    .login .logo img {
        width: 200px;
        max-width: 85%;
    }
    
    .login .content {
        padding: 35px 25px;
        border-radius: 20px;
        box-shadow: var(--shadow-lg);
    }
    
    .login .content .form-title {
        font-size: 26px;
        margin-bottom: 30px;
        letter-spacing: -0.3px;
    }
    
    .login .content .form-group {
        margin-bottom: 18px;
    }
    
    .login .content .form-control {
        height: 52px;
        padding: 0 16px 0 52px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 12px;
    }
    
    .login .content .form-group::before {
        left: 16px;
        width: 18px;
        height: 18px;
    }
    
    .login .content select.form-control {
        padding-left: 52px;
        background-position: right 16px center;
    }
    
    .login .content .btn {
        height: 52px;
        font-size: 14px;
        letter-spacing: 1px;
        border-radius: 12px;
    }
    
    .login .content .alert {
        padding: 14px 18px;
        font-size: 13px;
        border-radius: 12px;
        margin-bottom: 20px;
    }
    
    .login .content .copyright {
        font-size: 11px;
        margin-top: 25px;
        padding-top: 20px;
        line-height: 1.7;
    }
    
    /* Reduce animation intensity on mobile */
    body.login::before,
    body.login::after {
        animation-duration: 35s;
    }
    
    .login .logo img {
        animation-duration: 5s;
    }
}

/* Responsive Design - Small Mobile */
@media (max-width: 360px) {
    .login .content .logo img {
        width: 140px;
    }
    
    .login .content {
        padding: 30px 20px;
    }
    
    .login .content .form-title {
        font-size: 24px;
        margin-bottom: 25px;
    }
    
    .login .content .form-control {
        height: 50px;
        padding: 0 14px 0 48px;
        font-size: 16px;
    }
    
    .login .content .form-group::before {
        left: 14px;
        width: 16px;
        height: 16px;
    }
    
    .login .content select.form-control {
        padding-left: 48px;
    }
    
    .login .content .btn {
        height: 50px;
        font-size: 13px;
    }
    
    .login .content .copyright {
        font-size: 10px;
        margin-top: 20px;
        padding-top: 18px;
    }
}

/* Landscape Orientation */
@media (max-height: 600px) and (orientation: landscape) {
    body.login {
        padding: 10px;
    }
    
    .login .logo {
        margin-top: 5px;
        margin-bottom: 15px;
    }
    
    .login .logo img {
        width: 180px;
    }
    
    .login .content {
        padding: 25px 30px;
        margin: 10px auto;
    }
    
    .login .content .form-title {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .login .content .form-group {
        margin-bottom: 15px;
    }
    
    .login .content .form-control {
        height: 48px;
        padding: 0 16px 0 50px;
    }
    
    .login .content .btn {
        height: 48px;
        margin-top: 8px;
    }
    
    .login .copyright {
        margin-top: 15px;
        font-size: 11px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .login .content .form-control {
        font-size: 16px;
    }
    
    .login .content .btn {
        min-height: 48px;
    }
    
    .login .content .btn:active {
        transform: scale(0.98);
    }
    
    .login .content .logo img:hover {
        transform: none;
    }
}

/* Large Screens */
@media (min-width: 1200px) {
    .login .content {
        max-width: 500px;
        padding: 45px 50px 55px 50px;
    }
    
    .login .content .logo img {
        width: 200px;
    }
    
    .login .content .copyright {
        margin-top: 28px;
        padding-top: 22px;
        font-size: 11px;
    }
    
    .login .content .form-title {
        font-size: 36px;
    }
}

/* Reset Password Modal - Modern Style */
#modal {
    z-index: 1050;
}

#modal .modal-header,
#modal .modal-body,
#modal .modal-footer {
    background: var(--white);
    border: none;
}

#modal .modal-header {
    padding: 20px 24px 10px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

#modal .modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

#modal .modal-body {
    padding: 18px 24px 10px 24px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

#modal .modal-body .form-group {
    margin-bottom: 16px;
}

#modal .modal-body .control-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

#modal .modal-body .col-md-4,
#modal .modal-body .col-md-6 {
    float: none;
    width: 100%;
    padding: 0;
}

#modal .modal-body input.form-control {
    height: 46px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--light-bg);
}

#modal .modal-footer {
    padding: 10px 24px 22px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

#modal .modal-footer .btn.green {
    min-width: 140px;
    height: 44px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

#modal .close {
    opacity: 0.5;
    font-size: 22px;
}

#modal .close:hover {
    opacity: 0.8;
}

@media (max-width: 480px) {
    #modal .modal-header,
    #modal .modal-body,
    #modal .modal-footer {
        padding-left: 18px;
        padding-right: 18px;
    }

    #modal .modal-title {
        font-size: 16px;
    }

    #modal .modal-body input.form-control {
        height: 42px;
    }

    #modal .modal-footer .btn.green {
        width: 100%;
        min-width: 0;
    }
}

/* Hide default hide class */
.login .content .form-group.hide {
    display: none !important;
}

/* Ensure logo inside content is always visible */
.login .content .logo {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Pulsate effect removed */
#pulsate-regular {
    padding: 0 !important;
}

/* Prevent horizontal scroll */
* {
    max-width: 100%;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

/* iOS Safari fixes */
@supports (-webkit-touch-callout: none) {
    body.login {
        min-height: -webkit-fill-available;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .login .content {
        box-shadow: var(--shadow-xl);
    }
}

/* Print styles */
@media print {
    body.login {
        background: white;
    }
    
    .login .content {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
