:root {
    --pos-primary: #1a3a52; /* Dark Blue */
    --pos-primary-dark: #0f2438; /* Darker Blue */
    --pos-primary-light: #2d5a7b; /* Lighter Blue */
    --pos-accent: #00d4ff; /* Cyan Accent */
    --pos-dark: #0a0e27; /* Almost Black */
    --pos-white: #ffffff;
    --pos-light-gray: #f5f7fa;
    --pos-border-gray: #e0e6ed;
    --pos-text-dark: #1a1f3a;
    --pos-text-light: #6c7693;
    --pos-success: #10b981;
    --pos-error: #ef4444;
    --pos-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --pos-shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
}

body.pos-login-page {
    background: linear-gradient(135deg, var(--pos-dark) 0%, var(--pos-primary) 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--pos-text-dark);
    position: relative;
    min-height: 100vh;
}

/* Background Accents */
.pos-login-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
}

.pos-bg-accent {
    position: fixed;
    opacity: 0.05;
    border-radius: 50%;
    z-index: 0;
}

.pos-bg-accent-1 {
    width: 400px;
    height: 400px;
    background: var(--pos-accent);
    top: -100px;
    right: -100px;
    animation: float 6s ease-in-out infinite;
}

.pos-bg-accent-2 {
    width: 300px;
    height: 300px;
    background: var(--pos-accent);
    bottom: -50px;
    left: -50px;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(30px);
    }
}

/* Main Container */
.pos-login-main {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px 0;
}

/* Login Card */
.pos-login-card {
    background: var(--pos-white);
    border-radius: 20px;
    box-shadow: var(--pos-shadow-lg);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
    animation: slideUp 0.5s ease-out;
}

.pos-login-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.2);
}

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

/* Login Header */
.pos-login-header {
    background: linear-gradient(135deg, var(--pos-primary) 0%, var(--pos-primary-light) 100%);
    padding: 40px 30px 35px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.pos-login-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 50%;
    transform: translate(50%, -50%);
}

.pos-logo-container {
    margin-bottom: 20px;
    animation: slideDown 0.6s ease-out;
}

.pos-logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: rgba(0, 212, 255, 0.2);
    border: 2px solid var(--pos-accent);
    border-radius: 15px;
    font-size: 36px;
    color: var(--pos-accent);
    transition: all 0.3s ease;
}

.pos-logo-badge:hover {
    transform: scale(1.1) rotate(5deg);
    background: rgba(0, 212, 255, 0.3);
}

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

.pos-system-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--pos-white);
    margin: 15px 0 5px;
    letter-spacing: -0.5px;
}

.pos-system-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0;
}

.pos-header-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.3), transparent);
    margin-top: 20px;
}

/* Login Body */
.pos-login-body {
    padding: 40px 30px;
}

.pos-welcome-text {
    margin-bottom: 30px;
    text-align: center;
}

.pos-welcome-text h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--pos-text-dark);
    margin-bottom: 8px;
}

.pos-welcome-text p {
    font-size: 14px;
    color: var(--pos-text-light);
    margin: 0;
}

/* Form Styles */
.pos-login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.pos-form-group {
    position: relative;
}

.pos-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.pos-input-icon {
    position: absolute;
    left: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--pos-text-light);
    transition: color 0.3s ease;
}

.pos-form-control {
    width: 100%;
    padding: 14px 16px 14px 50px;
    border: 2px solid var(--pos-border-gray);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    background: var(--pos-light-gray);
    color: var(--pos-text-dark);
    transition: all 0.3s ease;
    outline: none;
}

.pos-form-control:focus {
    background: var(--pos-white);
    border-color: var(--pos-accent);
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.1);
}

.pos-form-control:focus + .pos-input-icon,
.pos-form-control:focus ~ .pos-input-icon {
    color: var(--pos-accent);
}

.pos-form-control::placeholder {
    color: var(--pos-text-light);
}

/* Password Toggle Button */
.pos-password-toggle {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--pos-text-light);
    transition: all 0.3s ease;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.pos-password-toggle:focus {
    outline: 2px solid var(--pos-accent);
    outline-offset: 2px;
}

/* Submit Button */
.pos-login-btn {
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.pos-login-submit {
    background: linear-gradient(135deg, var(--pos-primary) 0%, var(--pos-primary-light) 100%);
    color: var(--pos-white);
    margin-top: 10px;
}

.pos-login-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(26, 58, 82, 0.3);
}

.pos-login-submit:active:not(:disabled) {
    transform: translateY(0);
}

.pos-login-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.pos-btn-label {
    display: block;
}

.pos-btn-spinner {
    display: none;
    font-size: 14px;
}

.pos-login-submit.is-loading .pos-btn-label {
    display: none;
}

.pos-login-submit.is-loading .pos-btn-spinner {
    display: block;
}

/* Feedback Messages */
.pos-login-feedback {
    min-height: 24px;
    font-size: 14px;
    line-height: 1.5;
    padding: 12px;
    border-radius: 8px;
    animation: fadeIn 0.3s ease;
}

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

.pos-login-feedback.alert {
    display: block;
}

.pos-login-feedback.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.pos-login-feedback.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Login Footer */
.pos-login-footer {
    padding: 16px 30px;
    background: var(--pos-light-gray);
    border-top: 1px solid var(--pos-border-gray);
    text-align: center;
}

.pos-footer-text {
    font-size: 12px;
    color: var(--pos-text-light);
    margin: 0;
    letter-spacing: 0.5px;
}

/* Side Info (Desktop) */
.pos-side-info {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0 20px;
}

.pos-info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.1);
    border-radius: 12px;
    color: var(--pos-white);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    animation: slideUp 0.6s ease-out;
    animation-fill-mode: both;
}

.pos-info-item:nth-child(1) {
    animation-delay: 0.1s;
}

.pos-info-item:nth-child(2) {
    animation-delay: 0.2s;
}

.pos-info-item:nth-child(3) {
    animation-delay: 0.3s;
}

.pos-info-item:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateX(10px);
}

.pos-info-item i {
    font-size: 20px;
    color: var(--pos-accent);
    min-width: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pos-login-header {
        padding: 30px 20px 25px;
    }

    .pos-login-body {
        padding: 30px 20px;
    }

    .pos-system-title {
        font-size: 24px;
    }

    .pos-welcome-text h2 {
        font-size: 20px;
    }

    .pos-form-control {
        padding: 12px 14px 12px 45px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .pos-input-icon {
        left: 12px;
        font-size: 14px;
    }

    .pos-password-toggle {
        right: 12px;
        font-size: 14px;
    }

    .pos-logo-badge {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }

    .pos-login-footer {
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    body.pos-login-page {
        padding: 10px;
    }

    .pos-login-card {
        border-radius: 16px;
    }

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

    .pos-login-body {
        padding: 25px 16px;
    }

    .pos-system-title {
        font-size: 20px;
    }

    .pos-system-subtitle {
        font-size: 11px;
    }

    .pos-welcome-text h2 {
        font-size: 18px;
    }

    .pos-welcome-text p {
        font-size: 13px;
    }

    .pos-form-group {
        margin-bottom: 5px;
    }

    .pos-login-form {
        gap: 14px;
    }

    .pos-form-control {
        padding: 11px 12px 11px 40px;
        font-size: 16px;
        border-radius: 10px;
    }

    .pos-login-btn {
        padding: 12px 16px;
        font-size: 13px;
    }

    .pos-logo-badge {
        width: 55px;
        height: 55px;
        font-size: 26px;
    }
}

/* Print Styles */
@media print {
    body.pos-login-page {
        background: var(--pos-white);
    }

    .pos-bg-accent {
        display: none;
    }

    .pos-login-card {
        box-shadow: none;
        border: 1px solid var(--pos-border-gray);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

@media (prefers-color-scheme: dark) {
    /* For systems that support dark mode preferences */
    body.pos-login-page {
        background: linear-gradient(135deg, var(--pos-dark) 0%, var(--pos-primary-dark) 100%);
    }
}

/* Focus Visible for Keyboard Navigation */
.pos-form-control:focus-visible,
.pos-login-submit:focus-visible,
.pos-password-toggle:focus-visible {
    outline: 2px solid var(--pos-accent);
    outline-offset: 2px;
}
