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

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #fafbfc;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.5;
}

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

.login-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 48px 40px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02), 0 8px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

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

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

.login-header h1 {
    color: #1a1f36;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.login-header p {
    color: #8792a2;
    font-size: 14px;
    font-weight: 400;
}

/* Input Groups with Floating Labels */
.input-group {
    position: relative;
    margin-bottom: 24px;
}

.input-group input {
    width: 100%;
    background: #ffffff;
    border: 1px solid #e3e8ee;
    border-radius: 6px;
    padding: 16px 14px 8px 14px;
    color: #1a1f36;
    font-size: 16px;
    font-weight: 400;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.input-group input:focus {
    border-color: #635BFF;
}

.input-group input::placeholder {
    color: transparent;
}

.input-group label {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #8792a2;
    font-size: 16px;
    font-weight: 400;
    pointer-events: none;
    transition: all 0.2s ease;
    background: #ffffff;
    padding: 0 2px;
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    top: 0;
    font-size: 12px;
    font-weight: 500;
    color: #635BFF;
    transform: translateY(-50%);
}

.input-group input:not(:focus):not(:placeholder-shown) + label {
    color: #6b7385;
}

/* Custom Border Animation */
.input-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #635BFF;
    transition: width 0.3s ease;
}

.input-group input:focus ~ .input-border {
    width: 100%;
}

/* Password Toggle */
.input-group:has(.password-toggle) input {
    padding-right: 42px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #8792a2;
    padding: 6px;
    border-radius: 4px;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: #635BFF;
}

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

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #6b7385;
    font-weight: 500;
}

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

.checkmark {
    width: 18px;
    height: 18px;
    border: 1.5px solid #d1d9e0;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
    background: #635BFF;
    border-color: #635BFF;
    color: white;
}

.forgot-link {
    color: #635BFF;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: #4c44d4;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    background: #635BFF;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 14px 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    position: relative;
    margin-bottom: 24px;
    transition: all 0.2s ease;
    overflow: hidden;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.submit-btn:hover {
    background: #4c44d4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 91, 255, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: #a2a7b5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-text {
    transition: opacity 0.2s ease;
}

.btn-loader {
    position: absolute;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: #ffffff;
}

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

.submit-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: 1px;
    background: #e3e8ee;
}

.divider span {
    background: #ffffff;
    color: #8792a2;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 500;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.social-btn {
    flex: 1;
    background: #ffffff;
    color: #6b7385;
    border: 1px solid #e3e8ee;
    border-radius: 6px;
    padding: 12px 16px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    min-height: 44px;
}

.social-btn:hover {
    border-color: #d1d9e0;
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.social-btn:active {
    transform: translateY(0);
}

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

.signup-link a {
    color: #635BFF;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.signup-link a:hover {
    color: #4c44d4;
    text-decoration: underline;
}

/* Error States */
.error-message {
    color: #f56565;
    font-size: 12px;
    font-weight: 500;
    margin-top: 6px;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.2s ease;
}

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

.input-group.error input {
    border-color: #f56565;
    background: #fef5f5;
}

.input-group.error input:focus {
    border-color: #f56565;
}

.input-group.error label {
    color: #f56565;
}

.input-group.error .input-border {
    background: #f56565;
}

/* 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 {
    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: #1a1f36;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.success-message p {
    color: #8792a2;
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    body {
        padding: 16px;
    }
    
    .login-card {
        padding: 36px 28px;
        border-radius: 8px;
    }
    
    .login-header h1 {
        font-size: 1.375rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .social-buttons {
        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;
    }
}
