/**
 * Login Page Styles - Mobile Optimized
 * Jurnal PKL - SMK Rohmatul Ummah
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #2c5530 0%, #4a7c59 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 30px 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(44, 85, 48, 0.2);
}

.logo img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.app-title {
    text-align: center;
    margin-bottom: 25px;
}

.app-title h1 {
    font-size: 22px;
    font-weight: 700;
    color: #2c5530;
    margin-bottom: 5px;
}

.app-title p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #ffffff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: #4a7c59;
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.form-control::placeholder {
    color: #999;
    opacity: 1;
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #2c5530, #4a7c59);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.btn-login:hover {
    background: linear-gradient(45deg, #1e3a21, #356242);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(44, 85, 48, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}

.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.footer {
    text-align: center;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

/* Mobile optimizations */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .login-card {
        padding: 25px 20px;
        margin: 10px 0;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }
    
    .logo {
        width: 70px;
        height: 70px;
        margin-bottom: 15px;
    }
    
    .logo img {
        width: 45px;
        height: 45px;
    }
    
    .app-title h1 {
        font-size: 20px;
        margin-bottom: 3px;
    }
    
    .app-title p {
        font-size: 13px;
    }
    
    .form-control {
        padding: 14px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 48px;
    }
    
    .btn-login {
        padding: 14px;
        font-size: 16px;
        min-height: 48px;
    }
    
    .btn-login:active {
        transform: scale(0.98);
    }
    
    .alert {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .container {
        max-width: 100%;
    }
    
    .login-card {
        padding: 20px 15px;
        margin: 5px 0;
    }
    
    .app-title h1 {
        font-size: 18px;
    }
    
    .app-title p {
        font-size: 12px;
    }
    
    .form-control {
        padding: 12px 10px;
    }
    
    .btn-login {
        padding: 12px;
    }
}

/* Landscape mobile */
@media (max-height: 600px) and (orientation: landscape) {
    body {
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .logo {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
    }
    
    .logo img {
        width: 40px;
        height: 40px;
    }
    
    .app-title {
        margin-bottom: 15px;
    }
    
    .app-title h1 {
        font-size: 18px;
        margin-bottom: 2px;
    }
    
    .app-title p {
        font-size: 12px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .btn-login {
        margin-bottom: 10px;
    }
    
    .footer {
        margin-top: 10px;
        font-size: 11px;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo {
        box-shadow: 0 2px 8px rgba(44, 85, 48, 0.2);
    }
    
    .login-card {
        border: 0.5px solid rgba(255, 255, 255, 0.3);
    }
}

/* Dark mode support (future-proofing) */
@media (prefers-color-scheme: dark) {
    .form-control::placeholder {
        color: #bbb;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .form-control,
    .btn-login {
        transition: none;
    }
    
    .btn-login:hover {
        transform: none;
    }
}

/* Focus visible for accessibility */
.form-control:focus-visible,
.btn-login:focus-visible {
    outline: 2px solid #4a7c59;
    outline-offset: 2px;
}