/* Login Page Specific Styles */

/* Center the login box */
.container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 60vh;
    padding: 40px 20px 20px;
}

/* Login Box */
.login-box {
    background: var(--bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 450px;
    overflow: hidden;
}

/* Dark mode subtle adjustments */
[data-theme="dark"] .login-box {
    background: var(--bg);
    border: 1px solid var(--line);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.login-box-header {
    background: var(--wme-blue);
    padding: 32px 30px;
    text-align: center;
    color: white;
    border-bottom: 2px solid var(--wme-accent);
}

[data-theme="dark"] .login-box-header {
    background: rgba(20, 99, 184, 0.8);
    border-bottom-color: rgba(59, 143, 216, 0.6);
}

.login-box-header i {
    font-size: 42px;
    margin-bottom: 12px;
    opacity: 0.95;
}

.login-box-header h2 {
    font-size: 22px;
    margin: 0 0 6px;
    font-weight: 600;
}

.login-box-header p {
    margin: 0;
    opacity: 0.92;
    font-size: 13px;
}

/* Form inside login box */
.login-box form {
    padding: 28px;
}

.login-box .form-group {
    margin-bottom: 18px;
}

.login-box .form-group:last-of-type {
    margin-bottom: 24px;
}

.login-box .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: var(--ink);
}

.login-box .form-group label i {
    margin-right: 6px;
    color: var(--wme-blue);
}

.login-box input,
.login-box select {
    width: 100%;
    padding: 10px 12px;
    box-sizing: border-box;
}

.login-box select {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--ink);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.login-box select:hover {
    border-color: var(--wme-blue);
}

.login-box select:focus {
    outline: none;
    border-color: var(--wme-blue);
    box-shadow: 0 0 0 3px rgba(20, 99, 184, 0.1);
}

[data-theme="dark"] .login-box select {
    background: var(--bg);
    border-color: var(--line);
    color: var(--ink);
}

/* Input with domain suffix */
.input-with-domain {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-domain input {
    padding-right: 80px !important;
}

.domain-suffix {
    position: absolute;
    right: 1px;
    top: 1px;
    bottom: 1px;
    padding: 0 15px;
    background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,1) 10px, #f0f4f8);
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    border-left: 1px solid #e5e7eb;
    border-radius: 0 3px 3px 0;
    pointer-events: none;
}

/* Dark mode adjustments */
[data-theme="dark"] .domain-suffix {
    background: linear-gradient(to right, rgba(31,41,55,0), rgba(31,41,55,1) 10px, #374151);
    color: #9ca3af;
    border-left: 1px solid #4b5563;
}

/* Password wrapper with toggle button */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 45px !important;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
    transition: color 0.2s ease;
    z-index: 2;
}

.password-toggle:hover {
    color: var(--wme-blue);
}

.password-toggle:focus {
    outline: none;
}

/* Dark mode password toggle */
[data-theme="dark"] .password-toggle {
    color: #9ca3af;
}

[data-theme="dark"] .password-toggle:hover {
    color: var(--wme-blue);
}

/* Login footer links */
.login-footer {
    padding: 0 28px 24px;
    text-align: center;
    border-bottom: 1px solid var(--line);
}

.login-footer p {
    margin: 8px 0;
    font-size: 13px;
    color: var(--muted);
}

.login-footer a {
    color: var(--wme-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.login-footer a:hover {
    color: var(--wme-accent);
    text-decoration: underline;
}

/* Error message */
.error-message {
    background: #fee;
    color: var(--danger);
    padding: 12px 16px;
    margin: 0 28px 20px 28px;
    border-radius: 6px;
    display: none;
    font-size: 13px;
    border-left: 3px solid var(--danger);
}

[data-theme="dark"] .error-message {
    background: rgba(248, 81, 73, 0.15);
    border-left-color: rgba(248, 81, 73, 0.8);
}

.error-message.show {
    display: block;
}

/* Inline notifications (for forms) */
.login-box .notification {
    position: static;
    margin: 0 28px 20px 28px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    animation: none;
}

.login-box .notification.success {
    background: #d4edda;
    color: #155724;
    border-left: 3px solid #28a745;
}

.login-box .notification.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 3px solid #dc3545;
}

[data-theme="dark"] .login-box .notification.success {
    background: rgba(52, 208, 88, 0.15);
    color: #86efac;
    border-left-color: rgba(52, 208, 88, 0.8);
}

[data-theme="dark"] .login-box .notification.error {
    background: rgba(248, 81, 73, 0.15);
    color: #fca5a5;
    border-left-color: rgba(248, 81, 73, 0.8);
}

/* Help text */
.help-text {
    padding: 20px 28px 24px;
    background: var(--bg-alt);
    border-top: 1px solid var(--line);
}

.help-text p {
    margin: 6px 0;
    font-size: 12px;
    color: var(--muted);
    text-align: center;
}

.help-text p:first-child {
    font-weight: 500;
    color: var(--ink);
}

.help-text i {
    margin-right: 6px;
    color: var(--wme-blue);
}

.help-text a {
    color: var(--wme-blue);
    text-decoration: none;
    font-weight: 500;
}

.help-text a:hover {
    text-decoration: underline;
}

/* Login button */
.login-box .btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 4px;
}

/* Spinner for loading button */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 6px;
}

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

/* Products Selection */
.products-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.product-option {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    background: var(--bg-alt);
    border: 2px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: normal;
    margin: 0;
}

.product-option:hover {
    background: var(--bg);
    border-color: rgba(20, 99, 184, 0.3);
    box-shadow: 0 2px 4px rgba(20, 99, 184, 0.08);
}

[data-theme="dark"] .product-option {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .product-option:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(59, 143, 216, 0.4);
    box-shadow: 0 2px 4px rgba(59, 143, 216, 0.15);
}

.product-option input[type="checkbox"] {
    display: none;
}

.product-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

[data-theme="dark"] .product-checkbox {
    border-color: #4b5563;
}

/* Checked state - highlight the entire option */
.product-option input[type="checkbox"]:checked ~ .product-checkbox {
    background: var(--wme-blue);
    border-color: var(--wme-blue);
}

.product-option:has(input[type="checkbox"]:checked) {
    background: rgba(20, 99, 184, 0.08);
    border-color: var(--wme-blue);
    box-shadow: 0 2px 6px rgba(20, 99, 184, 0.12);
}

[data-theme="dark"] .product-option:has(input[type="checkbox"]:checked) {
    background: rgba(59, 143, 216, 0.15);
    border-color: rgba(59, 143, 216, 0.6);
    box-shadow: 0 2px 6px rgba(59, 143, 216, 0.2);
}

.product-option img {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    flex-shrink: 0;
}

.product-name {
    font-size: 14px;
    color: var(--ink);
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px 16px;
    }

    .login-box {
        max-width: 100%;
    }

    .login-box form {
        padding: 24px 20px;
    }

    .login-footer,
    .help-text {
        padding-left: 20px;
        padding-right: 20px;
    }

    .error-message {
        margin-left: 20px;
        margin-right: 20px;
    }
}
