/* Modern Brutalist Login Form - Complete & Self-Contained */

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

body {
    font-family: 'Arial', sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.4;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: #ffffff;
    border: 3px solid #000000;
    border-radius: 0;
    padding: 40px;
    box-shadow: 8px 8px 0 #000000;
    transition: all 0.2s ease;
}

.login-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 10px 10px 0 #000000;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.logo-square {
    width: 48px;
    height: 48px;
    background: #000000;
    border: 3px solid #000000;
    position: relative;
}

.logo-square::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: #ffffff;
}

.login-header h2 {
    color: #000000;
    font-size: 1.75rem;
    font-weight: 900;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-header p {
    color: #666666;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Form Styles */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    border: 2px solid #000000;
    background: #ffffff;
}

.input-wrapper input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 12px 16px;
    color: #000000;
    font-size: 16px;
    font-weight: 500;
    outline: none;
    font-family: inherit;
}

.input-wrapper input::placeholder {
    color: #999999;
}

.input-wrapper:focus-within {
    box-shadow: 4px 4px 0 #000000;
    transform: translate(-2px, -2px);
}

/* Password Toggle */
.password-wrapper {
    display: flex;
    align-items: center;
}

.password-wrapper input {
    flex: 1;
    padding-right: 60px;
}

.password-toggle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    background: #000000;
    color: #ffffff;
    border: none;
    padding: 0 12px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.password-toggle:hover {
    background: #333333;
}

.password-toggle:active {
    transform: scale(0.98);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    font-weight: 600;
    color: #000000;
}

.checkbox-box {
    width: 16px;
    height: 16px;
    border: 2px solid #000000;
    background: #ffffff;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-label .checkbox-box {
    background: #000000;
}

.checkbox-box::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-label .checkbox-box::after {
    opacity: 1;
}

.forgot-link {
    color: #000000;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.forgot-link:hover {
    border-bottom-color: #000000;
}

/* Login Button */
.login-btn {
    width: 100%;
    background: #000000;
    color: #ffffff;
    border: 2px solid #000000;
    padding: 16px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    margin-bottom: 24px;
    transition: all 0.2s ease;
    overflow: hidden;
}

.login-btn:hover {
    background: #333333;
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 #000000;
}

.login-btn:active {
    transform: translate(0, 0);
    box-shadow: 2px 2px 0 #000000;
}

.btn-text {
    position: relative;
    z-index: 1;
    transition: opacity 0.2s ease;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 3px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.loader-bar {
    width: 3px;
    height: 16px;
    background: #ffffff;
    animation: loaderPulse 1s ease-in-out infinite;
}

.loader-bar:nth-child(2) { animation-delay: 0.2s; }
.loader-bar:nth-child(3) { animation-delay: 0.4s; }

@keyframes loaderPulse {
    0%, 80%, 100% { transform: scaleY(0.5); opacity: 0.5; }
    40% { transform: scaleY(1); opacity: 1; }
}

.login-btn.loading .btn-text {
    opacity: 0;
}

.login-btn.loading .btn-loader {
    opacity: 1;
}

/* Divider */
.divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #000000;
    transform: translateY(-50%);
}

.divider span {
    background: #ffffff;
    color: #000000;
    padding: 0 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

/* Social Login */
.social-login {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.social-btn {
    flex: 1;
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
    padding: 12px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.social-btn:hover {
    background: #000000;
    color: #ffffff;
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0 #000000;
}

.social-btn:active {
    transform: translate(0, 0);
    box-shadow: 1px 1px 0 #000000;
}

/* Signup Link */
.signup-link {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #666666;
}

.signup-link a {
    color: #000000;
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.signup-link a:hover {
    border-bottom-color: #000000;
}

/* Error States */
.error-message {
    color: #dc3545;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 6px;
    margin-left: 2px;
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
}

.form-group.error .input-wrapper {
    border-color: #dc3545;
    animation: shake 0.3s ease-in-out;
}

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

/* Success Message */
.success-message {
    display: none;
    text-align: center;
    padding: 32px 20px;
    opacity: 0;
    transform: translateY(16px);
    transition: all 0.3s ease;
}

.success-message.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.success-icon {
    width: 48px;
    height: 48px;
    background: #000000;
    color: #ffffff;
    border: 2px solid #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
    margin: 0 auto 16px;
    animation: successPop 0.5s ease-out;
}

@keyframes successPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.success-message h3 {
    color: #000000;
    font-size: 1.25rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.success-message p {
    color: #666666;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    body {
        padding: 16px;
    }
    
    .login-card {
        padding: 28px;
        box-shadow: 6px 6px 0 #000000;
    }
    
    .login-card:hover {
        transform: translate(-1px, -1px);
        box-shadow: 7px 7px 0 #000000;
    }
    
    .login-header h2 {
        font-size: 1.5rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .social-login {
        flex-direction: column;
    }
}
/* === Accessibility: keyboard focus indicators === */
/* Restores visible focus rings for keyboard users without affecting mouse interaction. */
:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Reduced motion: respect user preference. Animations defined per form will tone down. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
