/* Login Page Styles for WF SecurityCloud */

:root {
    /* Updated Color Palette */
    --primary-color: #e5c738;
    --primary-hover: #d4b52f;
    --primary-light: rgba(229, 199, 56, 0.1);
    
    --background-dark: #0a0a0a;
    --surface-dark: #141414;
    --surface-elevated: #1a1a1a;
    --surface-hover: #242424;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    
    --border-color: #2a2a2a;
    --border-focus: var(--primary-color);
    
    --error-color: #ff4444;
    --success-color: #4ecdc4;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(229, 199, 56, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background-color: var(--background-dark);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 72px 0 24px;
}

/* Animated Background */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(229, 199, 56, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(229, 199, 56, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(229, 199, 56, 0.02) 0%, transparent 70%);
}

/* Login Container */
.center-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-container {
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 48px 40px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transition: all 0.3s ease;
}

/* Hover effect removed for better UX stability
.login-container:hover {
    box-shadow: var(--shadow-lg), 0 0 30px rgba(229, 199, 56, 0.3);
    transform: translateY(-2px);
} */

/* Logo Section */
.logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo img {
    height: 112px;
    width: auto;
    max-width: none;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
    object-fit: contain;
}

/* Typography */
h2 {
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 32px;
    font-size: 14px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    background: var(--surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 500;
    transition: all 0.2s ease;
    -webkit-appearance: none;
}

input[type="email"]:hover,
input[type="password"]:hover,
input[type="text"]:hover {
    background: var(--surface-hover);
    border-color: #3a3a3a;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--surface-hover);
    box-shadow: 0 0 0 3px var(--primary-light);
}

input::placeholder {
    color: var(--text-muted);
}

/* Password Field with Toggle */
.password-container {
    position: relative;
}

.eye-container {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.eye-container:hover {
    color: var(--text-secondary);
}

.eye-container i {
    font-size: 18px;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--primary-color);
    color: var(--background-dark);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Unique shimmer effect on hover */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(0, 0, 0, 0.2) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.btn::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--primary-hover), var(--primary-color));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(229, 199, 56, 0.4);
}

.btn:hover::before {
    transform: translateX(100%);
}

.btn:hover::after {
    opacity: 0.5;
}

.btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(229, 199, 56, 0.3);
}

/* Secondary Button */
.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    position: relative;
}

.btn-secondary::before {
    background: linear-gradient(45deg, transparent 30%, var(--primary-color) 50%, transparent 70%);
    opacity: 0.3;
}

.btn-secondary::after {
    background: var(--primary-color);
    opacity: 0;
}

.btn-secondary:hover {
    background: transparent;
    border-color: var(--primary-hover);
    color: var(--primary-hover);
    box-shadow: inset 0 0 20px rgba(229, 199, 56, 0.1), 0 4px 15px rgba(229, 199, 56, 0.3);
}

.btn-secondary:hover::after {
    opacity: 0.1;
}

/* Links */
.forgot-password {
    display: inline-block;
    color: var(--primary-color);
    font-size: 14px;
    text-decoration: none;
    margin-top: 8px;
    transition: all 0.2s ease;
}

.forgot-password:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Generic text link style for login pages */
.text-link {
    color: var(--primary-color);
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.text-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Divider */
.or-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 32px 0;
    color: var(--text-muted);
    font-size: 14px;
    position: relative;
}

.or-separator::before,
.or-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.or-separator::before {
    margin-right: 16px;
}

.or-separator::after {
    margin-left: 16px;
}

.or-separator span {
    padding: 0 8px;
    white-space: nowrap;
    background: transparent;
    position: relative;
    z-index: 1;
}

.or-separator a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.or-separator a:hover {
    text-decoration: underline;
}

/* Language Selector */
.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

#select-language {
    padding: 8px 16px;
    background: var(--surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#select-language:hover {
    background: var(--surface-hover);
    border-color: #3a3a3a;
}

#select-language:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Loading State */
.btn.loading {
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid var(--background-dark);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.8s ease infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Error Messages */
.error-message {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: var(--error-color);
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Success Messages */
.success-message {
    background: rgba(78, 205, 196, 0.1);
    border: 1px solid rgba(78, 205, 196, 0.3);
    color: var(--success-color);
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .login-container {
        padding: 32px 24px;
    }
    
    h2 {
        font-size: 24px;
    }
    
    .logo img {
        height: 84px;
    }
}

/* Custom Checkbox Styles */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--surface-elevated);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-right: 8px;
}

input[type="checkbox"]:hover {
    border-color: var(--primary-color);
    background: var(--surface-hover);
}

input[type="checkbox"]:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid var(--background-dark);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(229, 199, 56, 0.2);
}

label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.auth-form-row {
    margin-bottom: 20px;
}

.auth-hidden {
    display: none !important;
}

.auth-form-row-between {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.auth-checkbox-label {
    align-items: center;
    color: var(--text-secondary);
    display: flex;
    font-size: 14px;
    letter-spacing: 0;
    margin: 0;
    text-transform: none;
}

.auth-checkbox-label-start {
    align-items: flex-start;
    line-height: 1.5;
}

.auth-button-icon-right {
    margin-left: 8px;
}

.auth-button-icon-left {
    margin-right: 8px;
}

.auth-full-width {
    width: 100%;
}

.auth-button-top {
    margin-top: 24px;
}

.password-requirements-intro,
.password-requirements-list {
    color: var(--text-secondary);
    font-size: 13px;
}

.password-requirements-intro {
    margin-bottom: 8px;
}

.password-requirements-list {
    margin: 0;
    padding-left: 20px;
}

.password-strength-message {
    align-items: center;
    display: inline-flex;
    gap: 6px;
}

.password-strength-strong {
    color: var(--success-color);
}

.password-strength-medium {
    color: var(--warning-color);
}

.password-strength-weak {
    color: var(--error-color);
}

.two-factor-user-info {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
}

.two-factor-user-icon,
.two-factor-purchase-icon {
    margin-right: 5px;
}

.two-factor-purchase-notice {
    color: var(--primary-color);
    font-size: 13px;
    margin-top: 8px;
}

.two-factor-code-input,
.two-factor-backup-input {
    font-family: monospace;
    text-align: center;
}

.two-factor-code-input {
    font-size: 24px;
    letter-spacing: 8px;
}

.two-factor-backup-link-row {
    margin-bottom: 20px;
    text-align: center;
}

.two-factor-backup-input {
    font-size: 18px;
    letter-spacing: 4px;
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Language Selector Styles */
.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.language-dropdown {
    position: relative;
    display: inline-block;
}

.language-selected {
    background: rgba(26, 26, 26, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 16px;
    min-width: 150px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.language-selected:hover {
    background: rgba(26, 26, 26, 0.98);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.language-selected.active {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(229, 199, 56, 0.2);
}

.language-selected i {
    font-size: 16px;
    color: var(--primary-color);
}

.language-selected .chevron {
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.language-selected.active .chevron {
    transform: rotate(180deg);
}

.language-options {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background: rgba(26, 26, 26, 0.98);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 150px;
    max-height: 300px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.language-options.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.language-option:hover {
    background: rgba(229, 199, 56, 0.1);
    color: var(--text-primary);
}

.language-option.selected {
    background: var(--primary-light);
    color: var(--primary-color);
    font-weight: 500;
}

.language-option i {
    width: 20px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.language-option.selected i {
    opacity: 1;
}

/* Scrollbar for language options */
.language-options::-webkit-scrollbar {
    width: 6px;
}

.language-options::-webkit-scrollbar-track {
    background: transparent;
}

.language-options::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.language-options::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
