/* LOGIN.CSS - Login Page Specific Styles */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Roboto", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s, color 0.3s;
    position: relative;
}

/* Container */
.container {
    text-align: center;
    max-width: 400px;
    width: 100%;
    padding: 0 20px;
    transform: translateY(-10%);
}

/* Logo section */
.logo {
    margin-bottom: 30px;
}

.logo img {
    content: var(--logo-image);
    width: 200px;
    height: auto;
    pointer-events: none;
}

.message {
    font-size: 1.2em;
    font-weight: 300;
    letter-spacing: 0.5px;
    margin-bottom: 40px;
}

/* Oneliner */
.oneliner {
    font-size: 0.9em;
    font-weight: 300;
    color: var(--text-color);
    opacity: 0.7;
    line-height: 1.4;
    min-height: 40px;
    text-align: center;
    width: 100%;
    margin-bottom: 30px;
}

.typing-cursor::after {
    content: '|';
    animation: cursor-blink 1s infinite;
}

@keyframes cursor-blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Login form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.form-group {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Input styling */
.auth-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1em;
    background-color: var(--prompt-bg);
    border: 1px solid var(--prompt-submit);
    border-radius: 6px;
    color: var(--text-color);
    transition: all 0.3s ease;
    outline: none;
}

.auth-input:focus {
    border-color: var(--button-bg);
}

.auth-input::placeholder {
    color: var(--prompt-placeholder);
}

/* Password input group */
.form-group:has(input[type="password"]) {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--prompt-placeholder);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

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

.password-toggle svg {
    width: 16px;
    height: 16px;
}

/* Password input with toggle button */
input[type="password"] {
    padding-right: 44px;
}

/* Login button */
.login-button {
    width: 100%;
    padding: 12px 24px;
    font-size: 1em;
    font-weight: 500;
    background-color: var(--button-bg);
    color: var(--button-color);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
}

.login-button:hover:not(:disabled) {
    background-color: var(--button-hover);
    transform: translateY(-1px);
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Button content */
.button-text {
    transition: opacity 0.3s ease;
}

.button-spinner {
    transition: opacity 0.3s ease;
}

.button-spinner.hidden {
    display: none;
}

/* Spinner animation */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--button-color);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.success-message {
    padding: 12px;
    color: #4caf50;
    font-size: 0.9em;
    text-align: center;
    transition: all 0.3s ease;
}

.success-message.hidden {
    display: none;
}

body.dark-theme .success-message {
    color: #81c784;
}

/* Error message */
.error-message {
    padding: 12px;
    color: #f44336;
    border-radius: 6px;
    font-size: 0.9em;
    text-align: center;
    transition: all 0.3s ease;
}

.error-message.hidden {
    display: none;
}

body.dark-theme .error-message {
    color: #ff5252;
}

/* Rate limit info */
.rate-limit-info {
    padding: 12px;
    color: #ff9800;
    font-size: 0.9em;
    text-align: center;
    transition: all 0.3s ease;
}

.rate-limit-info.hidden {
    display: none;
}

body.dark-theme .rate-limit-info {
    color: #ffb74d;
}

/* Login help */
.login-help {
    margin-top: 20px;
}

.help-text {
    font-size: 0.85em;
    color: var(--text-light);
    line-height: 1.4;
}
.help-text a {
    color: var(--system-link);
    text-decoration:none;
}
.help-text a:hover {
    text-decoration:underline;
}
/* Error state for inputs */
.auth-input.error {
    border-color: #f44336;
    animation: shake 0.5s ease-in-out;
}

body.dark-theme .auth-input.error {
    border-color: #ff5252;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Theme switcher */
.theme-switcher {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
}

.theme-switch-button {
    background: none;
    border: 2px solid var(--text-color);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.theme-switch-button:hover {
    opacity: 1;
    transform: scale(1.1);
}

.theme-switch-button svg {
    width: 20px;
    height: 20px;
}

/* Focus visible for accessibility */
.auth-input:focus-visible,
.login-button:focus-visible,
.password-toggle:focus-visible,
.theme-switch-button:focus-visible {
    border-color:var(--system-message-color);
}

/* Mobile responsive */
@media screen and (max-width: 480px) {
    .container {
        max-width: 340px;
        padding: 0 15px;
    }
    
    .logo img {
        width: 160px;
    }
    
    .message {
        font-size: 1.1em;
        margin-bottom: 30px;
    }
    
    .oneliner {
        font-size: 0.85em;
        margin-bottom: 25px;
    }
    
    .auth-input {
        padding: 10px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .login-button {
        padding: 12px 20px;
        min-height: 44px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .auth-input {
        border-width: 2px;
    }
    
    .login-button {
        border: 2px solid var(--button-bg);
    }
    
    .error-message {
        border-width: 2px;
    }
    
    .rate-limit-info {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .typing-cursor::after {
        animation: none;
        content: '';
    }
}

/* Print styles */
@media print {
    .theme-switcher {
        display: none;
    }
    
    .login-form {
        break-inside: avoid;
    }
}