:root {
    --primary-color: #DC2626;
    --primary-dark: #991B1B;
    --primary-light: #EF4444;
    --secondary-color: #FBBF24;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --white: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

* {
    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(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(220, 38, 38, 0.7) 100%),
        url('../../../assets/images/coverleyeco.webp') center/cover no-repeat;
    min-height: 100vh;
    max-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    position: relative;
    background-attachment: fixed;
    overflow-y: hidden;
}

.login-container {
    width: 100%;
    max-width: 380px;
    max-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.login-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.login-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

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

.login-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 25px 20px;
    text-align: center;
}

.login-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

.login-logo img {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

.login-header h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.login-header p {
    font-size: 12px;
    opacity: 0.9;
}

.login-body {
    padding: 25px 20px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-group label i {
    margin-right: 6px;
    color: var(--primary-color);
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 14px;
}

/* Specific selector to override .input-wrapper i */
.input-wrapper .toggle-password {
    position: absolute;
    right: 14px;
    left: auto; /* Reset the left property inherited from generic rule */
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    z-index: 2;
    transition: color 0.3s ease;
}

.toggle-password.animate {
    animation: iconPop 0.3s ease-out;
}

@keyframes iconPop {
    0% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.3); }
    100% { transform: translateY(-50%) scale(1); }
}

.toggle-password:hover {
    color: var(--primary-color);
}

.form-control {
    width: 100%;
    padding: 11px 40px 11px 40px;
    font-size: 13px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.1);
}

.form-control::placeholder {
    color: #9ca3af;
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 7px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-wrapper label {
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    margin: 0;
}

.forgot-password {
    font-size: 13px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--primary-dark);
}

.btn-login {
    width: 100%;
    padding: 11px;
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login i {
    margin-right: 8px;
}

.alert {
    padding: 11px 14px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 13px;
    display: flex;
    align-items: center;
    animation: slideDown 0.3s ease-out;
}

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

.alert i {
    margin-right: 8px;
    font-size: 16px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.login-footer {
    padding: 18px 20px;
    background: var(--light-color);
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--primary-color);
    background: var(--white);
    border: 2px solid var(--primary-color);
    border-radius: 7px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-back i {
    margin-right: 6px;
}

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: 8px;
        min-height: 100vh;
        max-height: 100vh;
        overflow-y: hidden;
    }

    .login-container {
        max-width: 100%;
        max-height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .login-card {
        border-radius: 10px;
    }

    .login-header {
        padding: 15px 12px;
    }

    .login-logo {
        width: 45px;
        height: 45px;
        margin-bottom: 10px;
    }

    .login-logo img {
        width: 35px;
        height: 35px;
    }

    .login-header h1 {
        font-size: 15px;
        margin-bottom: 3px;
    }

    .login-header p {
        font-size: 10px;
    }

    .login-body {
        padding: 15px 12px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .form-group label {
        font-size: 11px;
        margin-bottom: 5px;
    }

    .form-group label i {
        margin-right: 3px;
        font-size: 9px;
    }

    .input-wrapper i {
        left: 10px;
        font-size: 11px;
    }

    .form-control {
        padding: 8px 10px 8px 32px;
        font-size: 12px;
        border-radius: 7px;
        border-width: 1.5px;
    }

    .form-options {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 6px;
        margin-bottom: 12px;
    }

    .checkbox-wrapper input[type="checkbox"] {
        width: 13px;
        height: 13px;
        margin-right: 5px;
    }

    .checkbox-wrapper label {
        font-size: 10px;
    }

    .forgot-password {
        font-size: 10px;
    }

    .btn-login {
        padding: 9px;
        font-size: 12px;
        border-radius: 7px;
    }

    .btn-login i {
        margin-right: 5px;
        font-size: 11px;
    }

    .alert {
        padding: 8px 10px;
        margin-bottom: 12px;
        font-size: 10px;
        border-radius: 7px;
    }

    .alert i {
        margin-right: 6px;
        font-size: 12px;
    }

    .login-footer {
        padding: 12px;
    }

    .login-footer p {
        font-size: 10px;
        margin-bottom: 8px;
    }

    .btn-back {
        padding: 7px 14px;
        font-size: 10px;
        border-radius: 6px;
    }

    .btn-back i {
        margin-right: 3px;
        font-size: 9px;
    }
}
