/**
 * Login Page Styles - COPO Brand
 * Court of Public Opinion - YOU BE THE JUDGE
 * 
 * Version: 2.0.0
 * Updated: 2025-12-16
 * Aligned with COPO design system
 */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Use COPO brand colors from design-tokens.css */
:root {
    --copo-blue: #546DB4;
    --copo-blue-dark: #3D5391;
    --copo-red: #DA0000;
    --copo-charcoal: #434343;
    --copo-white: #FFFFFF;
    --copo-black: #000000;
    --copo-gray-100: #F9FAFB;
    --copo-gray-300: #D1D5DB;
    --copo-gray-500: #6B7280;
    --copo-gray-700: #374151;
    --color-error: #DC2626;
    --color-success: #059669;
    --spacing-unit: 8px;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", 
                 "Helvetica Neue", Arial, sans-serif;
    background-color: var(--copo-gray-100);
    color: var(--copo-black);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Container Styles */
.container {
    width: 100%;
    padding: var(--spacing-unit);
}

.login-container {
    background-color: var(--copo-white);
    max-width: 400px;
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 4);
    border-radius: 0; /* Square corners per COPO design */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 
                0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.logo {
    height: 60px;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--copo-black);
    margin-bottom: var(--spacing-unit);
}

/* Form Styles */
.login-form {
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.form-group {
    margin-bottom: calc(var(--spacing-unit) * 3);
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: var(--spacing-unit);
    color: var(--copo-black);
}

input {
    width: 100%;
    padding: calc(var(--spacing-unit) * 1.5);
    border: 1px solid var(--copo-gray-300);
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--copo-blue);
    box-shadow: 0 0 0 3px rgba(84, 109, 180, 0.1);
}

/* Password Field Styles - FIXED */
.password-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-container input {
    padding-right: 48px; /* Make room for the button */
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--copo-gray-500);
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--copo-blue);
}

.toggle-password svg {
    width: 20px;
    height: 20px;
}

/* Submit Button Styles - FIXED */
.submit-button {
    width: 100%;
    height: 44px;
    background-color: var(--copo-blue);
    color: var(--copo-white);
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    font-family: inherit;
}

.submit-button:hover {
    background-color: var(--copo-blue-dark);
}

.submit-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(84, 109, 180, 0.3);
}

.submit-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Spinner for Loading State */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--copo-white);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: var(--spacing-unit);
}

.hidden {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Form Links */
.form-links {
    text-align: center;
    margin-top: calc(var(--spacing-unit) * 3);
}

.form-links a {
    display: block;
    color: var(--copo-blue);
    text-decoration: none;
    font-size: 14px;
    margin-top: calc(var(--spacing-unit) * 2);
    transition: color 0.2s;
}

.form-links a:hover {
    color: var(--copo-blue-dark);
    text-decoration: underline;
}

/* Error States */
.error-message {
    color: var(--color-error);
    font-size: 14px;
    margin-top: var(--spacing-unit);
    display: block;
}

input.error {
    border-color: var(--color-error);
}

/* Responsive Adjustments */
@media (max-width: 767px) {
    .login-container {
        padding: calc(var(--spacing-unit) * 3);
    }
    
    h1 {
        font-size: 20px;
    }
}