/* ============================================
   PROFESSIONAL ADMIN LOGIN CSS
   Mobile & Desktop Responsive
   Version: 1.0
   ============================================ */

/* ========== RESET & BASE STYLES ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* Background Pattern */
body::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.05"><path fill="white" d="M10,10 L90,10 M10,20 L90,20 M10,30 L90,30 M10,40 L90,40 M10,50 L90,50 M10,60 L90,60 M10,70 L90,70 M10,80 L90,80 M10,90 L90,90 M10,10 L10,90 M20,10 L20,90 M30,10 L30,90 M40,10 L40,90 M50,10 L50,90 M60,10 L60,90 M70,10 L70,90 M80,10 L80,90 M90,10 L90,90"/></svg>');
    background-size: 30px 30px;
    pointer-events: none;
}

/* ========== MAIN CONTAINER ========== */
.login-wrapper {
    width: 100%;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-container {
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}

/* ========== LOGIN CARD ========== */
.login-card {
    background: #FFFFFF;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.3);
}

/* ========== HEADER SECTION ========== */
.login-header {
    background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
    padding: 48px 32px 40px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
    pointer-events: none;
}

.header-icon {
    font-size: 56px;
    margin-bottom: 16px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.login-header h1 {
    color: #FFFFFF;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-header p {
    color: #9CA3AF;
    font-size: 14px;
    margin: 0;
}

/* ========== FORM BODY ========== */
.login-body {
    padding: 40px 32px 32px 32px;
}

/* Form Groups */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.form-group label i {
    margin-right: 6px;
}

/* Input Fields */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: #9CA3AF;
    font-size: 18px;
    pointer-events: none;
}

.form-control {
    width: 100%;
    padding: 12px 16px 12px 44px;
    font-size: 15px;
    font-family: inherit;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    background: #FFFFFF;
    transition: all 0.2s ease;
    outline: none;
}

.form-control:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control:hover:not(:focus) {
    border-color: #D1D5DB;
}

/* Password Toggle Button */
.password-toggle {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #9CA3AF;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: #3B82F6;
}

/* ========== CHECKBOX & LINKS ========== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #4B5563;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3B82F6;
}

.forgot-link {
    color: #3B82F6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: #2563EB;
    text-decoration: underline;
}

/* ========== BUTTONS ========== */
.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-login:hover::before {
    width: 300px;
    height: 300px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

/* ========== DEMO CREDENTIALS BOX ========== */
.demo-credentials {
    background: #FEF3C7;
    border-radius: 12px;
    margin-top: 24px;
    border-left: 4px solid #F59E0B;
    padding: 14px 16px;
}

.demo-credentials p {
    margin: 0;
    font-size: 13px;
    color: #92400E;
    line-height: 1.5;
}

.demo-credentials strong {
    font-weight: 700;
    display: block;
    margin-bottom: 6px;
}

.demo-credentials i {
    margin-right: 4px;
}

/* ========== FOOTER ========== */
.login-footer {
    background: #F9FAFB;
    padding: 20px 32px;
    text-align: center;
    border-top: 1px solid #E5E7EB;
}

.login-footer p {
    margin: 0;
    font-size: 13px;
    color: #6B7280;
}

.login-footer p:first-child {
    margin-bottom: 6px;
}

.login-footer i {
    margin-right: 4px;
}

/* ========== BACK TO HOME LINK ========== */
.back-home {
    text-align: center;
    margin-top: 24px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-5px);
}

/* ========== ERROR MESSAGE (Hidden by default) ========== */
.error-message {
    background: #FEF2F2;
    border-left: 4px solid #EF4444;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 24px;
    display: none;
}

.error-message.show {
    display: block;
    animation: shake 0.5s ease;
}

.error-message p {
    margin: 0;
    color: #991B1B;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ========== SUCCESS MESSAGE ========== */
.success-message {
    background: #D1FAE5;
    border-left: 4px solid #10B981;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 24px;
    display: none;
}

.success-message.show {
    display: block;
    animation: slideDown 0.3s ease;
}

.success-message p {
    margin: 0;
    color: #065F46;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== LOADING STATE ========== */
.btn-login.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-login.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== RESPONSIVE DESIGN ========== */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    .login-wrapper {
        padding: 16px;
    }
    
    .login-card {
        border-radius: 20px;
    }
    
    .login-header {
        padding: 36px 24px 30px 24px;
    }
    
    .login-header h1 {
        font-size: 28px;
    }
    
    .header-icon {
        font-size: 48px;
    }
    
    .login-body {
        padding: 32px 24px 28px 24px;
    }
    
    .login-footer {
        padding: 16px 24px;
    }
    
    .form-control {
        padding: 11px 14px 11px 42px;
        font-size: 14px;
    }
    
    .input-icon {
        left: 12px;
        font-size: 16px;
    }
    
    .btn-login {
        padding: 12px;
        font-size: 15px;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .login-wrapper {
        padding: 12px;
    }
    
    .login-header {
        padding: 28px 20px 24px 20px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .header-icon {
        font-size: 40px;
        margin-bottom: 12px;
    }
    
    .login-header p {
        font-size: 13px;
    }
    
    .login-body {
        padding: 24px 20px 20px 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .form-control {
        padding: 10px 12px 10px 38px;
        font-size: 13px;
    }
    
    .input-icon {
        left: 10px;
        font-size: 14px;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 24px;
    }
    
    .checkbox-label {
        font-size: 13px;
    }
    
    .forgot-link {
        font-size: 13px;
    }
    
    .btn-login {
        padding: 11px;
        font-size: 14px;
    }
    
    .demo-credentials {
        padding: 12px 14px;
        margin-top: 20px;
    }
    
    .demo-credentials p {
        font-size: 12px;
    }
    
    .login-footer {
        padding: 14px 20px;
    }
    
    .login-footer p {
        font-size: 11px;
    }
    
    .back-link {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Small Mobile (380px and below) */
@media (max-width: 380px) {
    .login-header h1 {
        font-size: 22px;
    }
    
    .header-icon {
        font-size: 36px;
    }
    
    .login-body {
        padding: 20px 16px 16px 16px;
    }
    
    .form-control {
        padding: 9px 10px 9px 36px;
        font-size: 12px;
    }
    
    .btn-login {
        padding: 10px;
        font-size: 13px;
    }
    
    .demo-credentials p {
        font-size: 11px;
    }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    animation: fadeInUp 0.6s ease;
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
.form-control:focus-visible {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

.btn-login:focus-visible {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .form-control {
        border-width: 2px;
    }
    
    .btn-login {
        background: #0000EE;
    }
    
    .demo-credentials {
        border: 1px solid #92400E;
    }
}

/* ========== DARK MODE SUPPORT ========== */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }
    
    .login-card {
        background: #1F2937;
    }
    
    .login-header {
        background: linear-gradient(135deg, #111827 0%, #0F172A 100%);
    }
    
    .form-group label {
        color: #E5E7EB;
    }
    
    .form-control {
        background: #374151;
        border-color: #4B5563;
        color: #F3F4F6;
    }
    
    .form-control:focus {
        border-color: #3B82F6;
    }
    
    .checkbox-label {
        color: #D1D5DB;
    }
    
    .login-footer {
        background: #111827;
        border-top-color: #374151;
    }
    
    .login-footer p {
        color: #9CA3AF;
    }
    
    .demo-credentials {
        background: #451A03;
        border-left-color: #F59E0B;
    }
    
    .demo-credentials p {
        color: #FDE68A;
    }
}

/* ========== PRINT STYLES ========== */
@media print {
    body {
        background: white;
    }
    
    .login-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .btn-login,
    .back-home,
    .password-toggle {
        display: none;
    }
    
    .demo-credentials {
        border: 1px solid #ccc;
        background: #f9f9f9;
    }
}

/* ========== UTILITY CLASSES ========== */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }

/* ========== CUSTOM SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #F3F4F6;
}

::-webkit-scrollbar-thumb {
    background: #9CA3AF;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6B7280;
}

/* ========== TOOLTIP STYLES ========== */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #1F2937;
    color: white;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    display: none;
    z-index: 1000;
    margin-bottom: 8px;
}

[data-tooltip]:hover:before {
    display: block;
}