/* 2L_SV_PING_SCRIPTS - Login Page Styles */
/* Modern, Responsive, Glassmorphism Design */

:root {
    --bg-primary: #0a0c10;
    --bg-secondary: #111318;
    --bg-card: rgba(17, 19, 24, 0.95);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(88, 166, 255, 0.15);
    --text-primary: #ffffff;
    --text-secondary: #8b949e;
    --text-muted: #484f58;
    --accent-primary: #238636;
    --accent-primary-hover: #2ea043;
    --accent-info: #58a6ff;
    --accent-danger: #f85149;
    --accent-warning: #ffa657;
    --gradient-primary: linear-gradient(135deg, #238636 0%, #2ea043 50%, #3fb950 100%);
    --gradient-glow: linear-gradient(135deg, rgba(35, 134, 54, 0.4) 0%, rgba(46, 160, 67, 0.2) 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 40px rgba(35, 134, 54, 0.15);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Animated Background */
.login-page {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: radial-gradient(ellipse at top, #1f2937 0%, #0a0c10 50%);
    overflow: hidden;
}

.bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(88, 166, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(88, 166, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    pointer-events: none;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.bg-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(35, 134, 54, 0.15) 0%, transparent 70%);
    animation: pulse 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
}

/* Login Container */
.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

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

/* Login Card - Glassmorphism */
.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow: 
        var(--shadow-lg),
        0 0 60px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(88, 166, 255, 0.3) 50%, 
        transparent 100%);
}

/* Brand Section */
.login-brand {
    text-align: center;
    margin-bottom: 40px;
}

.login-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, #8b949e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.title-underline {
    width: 60px;
    height: 3px;
    background: var(--gradient-primary);
    margin: 16px auto 0;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(35, 134, 54, 0.4);
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.input-wrapper input {
    width: 100%;
    background: rgba(13, 17, 23, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px 14px 44px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-primary);
    transition: var(--transition-base);
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--accent-info);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1), 0 0 20px rgba(88, 166, 255, 0.1);
    background: rgba(13, 17, 23, 0.95);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.input-wrapper input:focus + .input-icon {
    color: var(--accent-info);
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    border-radius: var(--radius-sm);
}

.toggle-password:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Form Options */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -8px;
}

/* Custom Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.checkbox-container:hover {
    color: var(--text-primary);
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    background: rgba(13, 17, 23, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    position: relative;
}

.checkbox-container:hover .checkmark {
    border-color: var(--accent-info);
}

.checkbox-container input:checked + .checkmark {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(35, 134, 54, 0.4);
}

.checkbox-container input:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 11px;
    font-weight: bold;
}

.forgot-link {
    background: none;
    border: none;
    color: var(--accent-info);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    text-decoration: none;
}

.forgot-link:hover {
    color: var(--accent-info-hover);
    background: rgba(88, 166, 255, 0.1);
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 16px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-base);
    font-family: var(--font-primary);
    position: relative;
    overflow: hidden;
    background: var(--gradient-primary);
    color: white;
    box-shadow: 
        var(--shadow-sm),
        0 0 20px rgba(35, 134, 54, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    margin-top: 8px;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 
        var(--shadow-md),
        0 0 30px rgba(35, 134, 54, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-login:hover:not(:disabled)::before {
    width: 300px;
    height: 300px;
}

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

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.btn-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

.spinner circle {
    stroke: currentColor;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

@keyframes dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

/* Shake animation for errors */
.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Error Message */
.error-message {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.3);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    color: var(--accent-danger);
    font-size: 14px;
    text-align: center;
    margin-top: 20px;
    animation: slideIn 0.3s ease-out;
    font-weight: 500;
}

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

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-xl);
    padding: 40px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: rgba(248, 81, 73, 0.1);
    color: var(--accent-danger);
    transform: rotate(90deg);
}

.modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.modal-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.modal-btn {
    padding: 12px 32px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    font-family: var(--font-primary);
}

.modal-btn:hover {
    background: var(--accent-info);
    border-color: var(--accent-info);
    color: white;
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 480px) {
    .login-page {
        padding: 16px;
        align-items: flex-start;
        padding-top: 60px;
    }
    
    .login-card {
        padding: 32px 24px;
        border-radius: var(--radius-lg);
    }
    
    .login-title {
        font-size: 24px;
    }
    
    .title-underline {
        width: 50px;
        height: 2px;
    }
    
    .form-group label {
        font-size: 12px;
    }
    
    .input-wrapper input {
        padding: 12px 14px 12px 40px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .input-icon {
        left: 12px;
    }
    
    .toggle-password {
        right: 10px;
        padding: 5px;
    }
    
    .checkbox-container {
        font-size: 13px;
    }
    
    .forgot-link {
        font-size: 12px;
    }
    
    .btn-login {
        padding: 14px 20px;
        font-size: 14px;
    }
    
    .modal-content {
        padding: 32px 24px;
    }
    
    .modal-icon {
        font-size: 40px;
    }
    
    .modal-title {
        font-size: 18px;
    }
}

@media (max-width: 360px) {
    .login-title {
        font-size: 22px;
    }
    
    .form-options {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
}

/* Dark mode scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--accent-info);
    outline-offset: 2px;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: rgba(255, 255, 255, 0.3);
        --text-secondary: #a0a0a0;
    }
    
    .login-card {
        border: 2px solid var(--border-color);
    }
}