/**
 * JewelPOS Login Page Styles
 * Matching the main application design system
 */
:root {
    --primary-gradient: linear-gradient(to bottom, #8f94c9, #7b80b5);
    --background-gradient: linear-gradient(135deg, #5d618d, #4a4e7a);
    --content-bg: #c7dcf3;
    --border-color: #FFFFFF;
    --text-color: #00000078;
    --error-color: #e74c3c;
    --success-color: #2ecc71;
    --border-radius: 15px;
    --box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

body {
    margin: 0;
    padding: 20px;
    background: var(--background-gradient);
    font: normal 90% Arial, Helvetica, sans-serif;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.login-box {
    background: var(--content-bg);
    border: 3px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    text-align: center;
    animation: slideIn 0.5s ease-out;
}

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

.login-header {
    background: var(--primary-gradient);
    padding: 30px 25px;
    text-align: center;
    border-bottom: 3px solid var(--border-color);
}

.login-header h1 {
    color: #FFFFFF;
    margin: 0;
    font-size: 28px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-header h1 i {
    margin-right: 12px;
    font-size: 24px;
}

.login-subtitle {
    color: #b2b3ba;
    font-size: 14px;
    margin-top: 8px;
    font-style: italic;
}

.login-form {
    padding: 40px 30px;
}

.input-group {
    position: relative;
    margin-bottom: 25px;
    text-align: left;
}

.input-group i {
    position: absolute;
    left: 15px;
    bottom: 15px;
    color: var(--text-color);
    font-size: 16px;
    opacity: 0.7;
    pointer-events: none;
    z-index: 2;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--text-color);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input, select {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: Arial, Helvetica, sans-serif;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    transition: all 0.3s ease;
    box-sizing: border-box;
    height: 50px;
    line-height: 1.5;
    vertical-align: middle;
    position: relative;
    z-index: 1;
    overflow: visible;
}

input:focus, select:focus {
    outline: none;
    border-color: #8f94c9;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 10px rgba(143, 148, 201, 0.3);
}

input:hover, select:hover {
    border-color: #8f94c9;
}

/* Select dropdown styling */
select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 18px;
    padding: 12px 40px 12px 45px;
    line-height: normal;
}

select option {
    background: var(--content-bg);
    color: #333;
    padding: 10px;
    white-space: normal;
}

.login-button {
    width: 100%;
    padding: 18px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: bold;
    font-family: Arial, Helvetica, sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.login-button:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.2));
    transition: left 0.5s ease;
}

.login-button:hover:before {
    left: 100%;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

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

.alert {
    margin-top: 25px;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    border: 2px solid var(--border-color);
    animation: alertSlide 0.3s ease-out;
}

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

.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert i {
    font-size: 18px;
    flex-shrink: 0;
}

/* Enhanced focus states for accessibility */
input:focus, select:focus {
    outline: 3px solid rgba(143, 148, 201, 0.5);
    outline-offset: 2px;
}

/* Password visibility toggle */
.password-toggle {
    position: absolute;
    right: 25px;
    bottom: 5px;
    cursor: pointer;
    color: var(--text-color);
    opacity: 0.7;
    z-index: 10;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    transition: all 0.2s ease;
    width: 30px;
    height: 30px;
}

.password-toggle:hover {
    opacity: 1;
    color: #8f94c9;
    transition: all 0.2s ease;
}

/* Special padding for password field to accommodate toggle icon */
.input-group:has(#password) input {
    padding-right: 45px;
}

/* Fallback for browsers that don't support :has() */
#password {
    padding-right: 45px !important;
}

/* Responsive design */
@media (max-width: 600px) {
    .login-container {
        padding: 10px;
        max-width: 100%;
    }

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

    .login-form {
        padding: 30px 20px;
    }

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

    .login-header h1 {
        font-size: 24px;
    }
}

/* Loading state */
.login-button.loading {
    pointer-events: none;
    opacity: 0.7;
}

.login-button.loading:after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #FFFFFF;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.8s linear infinite;
}

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

/* ESS Portal Link */
.ess-portal-link {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    text-align: center;
}

.ess-portal-link a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #5d618d;
    text-decoration: none;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.ess-portal-link a:hover {
    background: rgba(93, 97, 141, 0.1);
    color: #4a4e7a;
}

.ess-portal-link a i {
    font-size: 16px;
}
