* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Force SVG icons to respect container size */
svg {
    max-width: 100%;
    max-height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
}

.login-wrapper {
    width: 100%;
    max-width: 520px;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 48px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    width: 120px;
    height: auto;
    margin-bottom: 20px;
}

.login-header h1 {
    color: #1a202c;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.subtitle {
    color: #718096;
    font-size: 15px;
    font-weight: 400;
}

/* Alert Styles */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-icon {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    flex-shrink: 0;
    margin-top: 2px;
    display: block;
    overflow: hidden;
}

.alert-icon svg {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    display: block;
}

.alert strong {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.alert p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.alert-warning {
    background-color: #fef3c7;
    border: 1px solid #fbbf24;
    color: #92400e;
}

.alert-error {
    background-color: #fee2e2;
    border: 1px solid #f87171;
    color: #991b1b;
}

/* Form Styles */
.login-form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.input-icon {
    position: absolute;
    left: 14px;
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    color: #9ca3af;
    pointer-events: none;
    flex-shrink: 0;
    display: block;
    overflow: hidden;
}

.input-icon svg {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    display: block;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 12px 12px 44px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    color: #1f2937;
    transition: all 0.2s ease;
    background: white;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.input-wrapper input::placeholder {
    color: #9ca3af;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    transition: color 0.2s ease;
}

.toggle-password:hover {
    color: #dc2626;
}

.eye-icon {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    flex-shrink: 0;
    display: block;
    overflow: hidden;
}

.eye-icon svg {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    display: block;
}

/* Button Styles */
.btn-login {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-icon {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    display: block;
    overflow: hidden;
}

.btn-icon svg {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    display: block;
}

.btn-login:hover .btn-icon {
    transform: translateX(4px);
}

/* Footer */
.login-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.login-footer p {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 4px;
}

.copyright {
    font-size: 12px;
    color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 480px) {
    .login-container {
        padding: 28px 24px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .logo {
        width: 100px;
    }
}

/* Loading State */
.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Accessibility */
.input-wrapper input:focus-visible,
.btn-login:focus-visible,
.toggle-password:focus-visible {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

/* SPA login shake animation on error */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-8px); }
    40%       { transform: translateX(8px); }
    60%       { transform: translateX(-5px); }
    80%       { transform: translateX(5px); }
}
