/**
 * Sharvaya POS ERP - Two-Color Professional Login Stylesheet
 * Two-Color Architecture: Crisp White + Deep Emerald Teal
 * Reference: Dual-pane showcase layout (clean ambient background, tinted showcase, pure white form)
 * Fully offline-ready (uses local fonts & assets)
 */

:root {
    --theme-primary: #0d9488;
    --theme-primary-hover: #0f766e;
    --theme-primary-active: #115e59;
    --theme-primary-subtle: #ccfbf1;
    --theme-primary-border: #99f6e4;
    --theme-focus-ring: rgba(13, 148, 136, 0.18);
    --login-bg-tint-1: #f0fdfa;
    --login-bg-tint-2: #ccfbf1;
    --login-card-bg: #ffffff;
    --login-border: #e2e8f0;
    --login-text-dark: #0f172a;
    --login-text-body: #1e293b;
    --login-text-muted: #64748b;
}

* {
    box-sizing: border-box;
}

body.login-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background:
        radial-gradient(circle at 15% 15%, rgba(13, 148, 136, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(99, 102, 241, 0.08) 0%, transparent 45%),
        linear-gradient(135deg, #f8fafc 0%, #f0fdfa 55%, #f8fafc 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 1.5rem;
    color: var(--login-text-dark);
}

/* Dual-Pane Login Shell */
.login-shell {
    width: 100%;
    max-width: 920px;
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 24px 60px -15px rgba(15, 23, 42, 0.12), 0 4px 16px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    display: flex;
    flex-direction: row;
    border: 1px solid #e2e8f0;
}

/* Left Branded Showcase Panel (Soft tinted panel) */
.login-showcase {
    flex: 0 0 45%;
    background: linear-gradient(155deg, #f0fdfa 0%, #ccfbf1 50%, #f0fdfa 100%);
    border-right: 1px solid #99f6e4;
    padding: 2.75rem 2.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.login-showcase::before {
    content: "";
    position: absolute;
    top: -60px;
    left: -60px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.login-showcase::after {
    content: "";
    position: absolute;
    bottom: -60px;
    right: -60px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.login-showcase-content {
    position: relative;
    z-index: 2;
}

.login-brand-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: #ffffff;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    box-shadow: 0 10px 22px rgba(13, 148, 136, 0.28);
    margin-bottom: 1.25rem;
}

.login-brand-title {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    color: #0f172a;
    line-height: 1.2;
}

.login-brand-title span {
    color: #0d9488;
}

.login-brand-desc {
    color: #334155;
    font-size: 0.88rem;
    line-height: 1.55;
    margin-bottom: 1.75rem;
}

.login-feature-pills {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.login-feature-pill {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(13, 148, 136, 0.22);
    border-radius: 12px;
    padding: 0.65rem 0.95rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-feature-pill:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.14);
}

.pill-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.92rem;
    flex-shrink: 0;
}

.pill-teal {
    background: #ccfbf1;
    color: #0f766e;
}

.pill-green {
    background: #dcfce7;
    color: #15803d;
}

.pill-blue {
    background: #e0f2fe;
    color: #0369a1;
}

.pill-amber {
    background: #fef3c7;
    color: #b45309;
}

.pill-purple {
    background: #f3e8ff;
    color: #7e22ce;
}

.pill-red {
    background: #ffe4e6;
    color: #e63946;
}

.login-showcase-footer {
    position: relative;
    z-index: 2;
    padding-top: 1.25rem;
    font-size: 0.82rem;
    color: #475569;
    display: flex;
    align-items: center;
    border-top: 1px solid rgba(13, 148, 136, 0.18);
}

.text-teal {
    color: #0d9488 !important;
}

/* Right Clean Login Form Pane (Pure White) */
.login-form-pane {
    flex: 1 1 55%;
    padding: 2.75rem 2.25rem;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.mobile-brand-banner {
    display: none;
    align-items: center;
    gap: 10px;
}

.mobile-brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.25);
}

.mobile-brand-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.mobile-brand-title span {
    color: #0d9488;
}

/* Form Titles */
.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ccfbf1;
    color: #0f766e;
    border: 1px solid #99f6e4;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    margin-bottom: 0.65rem;
    letter-spacing: 0.03em;
    width: fit-content;
}

.login-title {
    font-size: 1.55rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.3rem 0;
    letter-spacing: -0.02em;
}

.login-subtitle {
    font-size: 0.86rem;
    color: #64748b;
    margin: 0 0 1.5rem 0;
}

/* Form Groups & Inputs */
.login-form-pane .form-group {
    margin-bottom: 1.1rem;
}

.login-form-pane .form-label {
    display: block;
    font-size: 0.83rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}

.login-input-group {
    display: flex;
    align-items: stretch;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-input-group:focus-within {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.16);
}

.login-input-icon {
    background: #f8fafc;
    border: none;
    border-right: 1px solid #e2e8f0;
    padding: 0 14px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    min-width: 44px;
    box-sizing: border-box;
    transition: color 0.15s ease;
}

.login-input-group:focus-within .login-input-icon {
    color: #0d9488;
}

.login-input-control {
    flex: 1 1 auto;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 10px 14px;
    font-size: 0.92rem;
    color: #0f172a;
    background: transparent;
    width: 100%;
}

.login-input-control::placeholder {
    color: #94a3b8;
}

/* Native Select Styling & Modern Picker Customization */
.login-input-select,
.login-input-select::picker(select) {
    appearance: base-select;
}

/* Remove default black picker icon (arrow) so only theme chevron is shown */
.login-input-select::picker-icon,
select::picker-icon {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    content: none !important;
}

.login-input-select {
    cursor: pointer;
    accent-color: #0d9488;
    color-scheme: light;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230d9488'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 13px 13px;
    padding-right: 38px !important;
    color: #0f172a;
    font-weight: 500;
}

.login-input-select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230f766e'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
}

/* Modern Picker styling - explicitly positioned ABOVE the input */
.login-input-select::picker(select),
::picker(select) {
    appearance: base-select;
    position-area: top span-all !important;
    inset: auto !important;
    bottom: anchor(top) !important;
    left: anchor(left) !important;
    margin-bottom: 6px !important;
    background-color: #ffffff;
    border: 1.5px solid #0d9488;
    border-radius: 8px;
    box-shadow: 0 -8px 25px rgba(13, 148, 136, 0.15), 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 3px;
}

.login-input-select option {
    background-color: #ffffff;
    color: #0f172a;
    padding: 8px 12px;
    font-size: 0.92rem;
    font-weight: 500;
}

/* Selected / Hover / Focus state: Emerald Teal instead of OS blue */
.login-input-select option:checked,
.login-input-select option:hover,
.login-input-select option:focus,
.login-input-select option:active {
    background: #0d9488 linear-gradient(0deg, #0d9488 0%, #0d9488 100%) !important;
    background-color: #0d9488 !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px 100px #0d9488 inset !important;
    -webkit-text-fill-color: #ffffff !important;
}

option::checkmark {
    color: #ffffff !important;
}

/* Password Visibility Toggle */
.btn-password-toggle {
    background: #f8fafc;
    border: none;
    border-left: 1px solid #e2e8f0;
    color: #64748b;
    padding: 0 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background 0.15s ease;
}

.btn-password-toggle:hover {
    color: #0f172a;
    background: #f1f5f9;
}

/* Submit Button */
.btn-login-submit {
    width: 100%;
    padding: 12px 18px;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.96rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
    margin-top: 0.85rem;
}

.btn-login-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.38);
    transform: translateY(-1px);
}

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

.btn-login-submit:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

/* Alert / Status Message */
.login-alert {
    margin-top: 1.15rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.86rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.login-alert.alert-info {
    background: #f0fdfa;
    color: #0f766e;
    border: 1px solid #99f6e4;
}

.login-alert.alert-danger {
    background: #fff5f5;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.login-alert.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Legacy error-msg fallback class */
.error-msg {
    margin-top: 10px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Responsive Breakpoints */
@media (max-width: 880px) {
    body.login-page {
        padding: 1rem;
    }

    .login-shell {
        flex-direction: column;
        max-width: 480px;
        border-radius: 18px;
    }

    .login-showcase {
        display: none;
    }

    .mobile-brand-banner {
        display: flex;
    }

    .login-form-pane {
        padding: 2.25rem 1.75rem;
    }
}

@media (max-width: 480px) {
    body.login-page {
        padding: 0.75rem 0.5rem;
    }

    .login-shell {
        border-radius: 14px;
    }

    .login-form-pane {
        padding: 1.5rem 1.25rem;
    }

    .login-title {
        font-size: 1.35rem;
    }
}
