/* Apple-inspired Login Design with Orange Accents */

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

body {
    font-family: var(--font-family-text);
    height: 100vh;
    background: var(--background-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    overflow: hidden;
}

/* Main Container */
.login-container {
    display: flex;
    width: 100%;
    height: 100vh;
    margin: 0 auto;
    box-shadow: var(--shadow-heavy);
    border-radius: 0;
    overflow: hidden;
    background: var(--background-primary);
}

/* Left Side - Image Enhanced */
.login-left {
    flex: 1;
    position: relative;
    background: var(--gradient-orange-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.background-image {
    width: 100%;
    height: 100%;
    position: relative;
}

.background-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.8) contrast(1.1);
    transition: transform var(--transition-smooth);
}

.background-image:hover img {
    transform: scale(1.05);
}

/* Enhanced Overlay with White-Orange Gradient */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.2) 0%,
        rgba(255, 107, 53, 0.3) 50%,
        rgba(255, 107, 53, 0.4) 100%
    );
    backdrop-filter: blur(2px);
}

/* Enhanced Quote Section */
.quote {
    position: absolute;
    bottom: var(--space-16);
    left: var(--space-8);
    right: var(--space-8);
    z-index: 2;
    text-align: center;
    padding: var(--space-6);
    background: var(--overlay-light);
    border-radius: var(--radius-large);
    backdrop-filter: blur(10px);
    border: 1px solid var(--overlay-medium);
}

.quote p {
    color: var(--text-white);
    font-size: 24px;
    font-weight: 500;
    line-height: 1.4;
    font-style: italic;
    text-shadow: 0 2px 4px rgba(255, 107, 53, 0.4);
}

/* Right Side - Form Enhanced */
.login-right {
    flex: 1;
    background: var(--background-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    position: relative;
}

.login-right::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-orange-medium);
}

/* Enhanced Form Container */
.login-form-container {
    width: 100%;
    max-width: 380px;
    background: var(--background-primary);
    padding: var(--space-12);
    border-radius: var(--radius-large);
    border: 1px solid var(--separator-opaque);
    box-shadow: var(--shadow-medium);
    position: relative;
    transition: all var(--transition-smooth);
}

.login-form-container:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-heavy);
}

/* Enhanced Logo */
.logo-container {
    text-align: center;
    margin-bottom: var(--space-8);
    position: relative;
}

.logo {
    max-width: 80px;
    height: auto;
    transition: transform var(--transition-quick);
    filter: drop-shadow(0 4px 8px rgba(255, 107, 53, 0.2));
}

.logo:hover {
    transform: scale(1.05);
}

/* Enhanced System Info */
.system-info {
    text-align: center;
    margin-bottom: var(--space-10);
}

.system-info h1 {
    font-family: var(--font-family-display);
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
    letter-spacing: -0.022em;
    position: relative;
}

.system-info h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--gradient-orange-medium);
    border-radius: 2px;
}

.system-description {
    color: var(--text-secondary);
    font-size: 17px;
    line-height: 1.47;
}

/* Enhanced Form */
.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: var(--space-6);
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: var(--space-2);
    color: var(--text-primary);
    font-size: 17px;
    font-weight: 400;
    transition: color var(--transition-quick);
}

.form-group input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--separator);
    border-radius: var(--radius-medium);
    font-size: 17px;
    font-family: var(--font-family-text);
    background: var(--background-primary);
    color: var(--text-primary);
    transition: all var(--transition-quick);
    min-height: 44px;
}

/* Specjalne padding dla pola hasła (aby zrobić miejsce na obie ikony) */
#password {
    padding-right: 75px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px var(--focus-orange);
    transform: translateY(-1px);
}

.form-group input:focus + label,
.form-group.focused label {
    color: var(--primary-orange);
}

.form-group input::placeholder {
    color: var(--text-tertiary);
}

/* Enhanced Submit Button */
.submit-btn {
    width: 100%;
    padding: var(--space-4) var(--space-6);
    background: var(--gradient-orange-medium);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-medium);
    font-size: 17px;
    font-weight: 500;
    font-family: var(--font-family-text);
    cursor: pointer;
    transition: all var(--transition-quick);
    min-height: 44px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-orange);
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--overlay-medium), transparent);
    transition: left var(--transition-smooth);
}

.submit-btn:hover {
    background: var(--gradient-orange-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-orange-heavy);
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-orange);
}

.submit-btn:disabled {
    background: var(--gray-400);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Enhanced Input Icons */
.input-icon {
    position: absolute;
    right: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 16px;
    margin-top: var(--space-3);
    transition: color var(--transition-quick);
    z-index: 10;
}



.form-group:focus-within .input-icon {
    color: var(--primary-orange);
}

.password-toggle {
    cursor: pointer;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    transition: color var(--transition-quick);
    z-index: 15;
    font-size: 16px;
    padding: 4px;
    margin-top: var(--space-3);
}

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

/* Enhanced Messages */
.error-message {
    background: var(--white-soft);
    color: var(--system-red);
    padding: var(--space-4);
    border-radius: var(--radius-medium);
    border: 1px solid var(--system-red);
    margin-top: var(--space-4);
    font-size: 15px;
    text-align: center;
    animation: slideInDown 0.3s ease-out;
}

.success-message {
    background: var(--white-soft);
    color: var(--system-green);
    padding: var(--space-4);
    border-radius: var(--radius-medium);
    border: 1px solid var(--system-green);
    margin-top: var(--space-4);
    font-size: 15px;
    text-align: center;
    animation: slideInDown 0.3s ease-out;
}

.warning-message {
    background: var(--background-orange-light);
    color: var(--primary-orange-dark);
    padding: var(--space-4);
    border-radius: var(--radius-medium);
    border: 1px solid var(--primary-orange);
    margin-top: var(--space-4);
    font-size: 15px;
    text-align: center;
    animation: slideInDown 0.3s ease-out;
}

/* Enhanced Loader */
.loader {
    text-align: center;
    padding: var(--space-6);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--separator);
    border-top: 2px solid var(--primary-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-4);
}

.loader p {
    color: var(--text-secondary);
    font-size: 15px;
}

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

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Form Focus States */
.form-group.focused .form-input {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px var(--focus-orange);
    transform: translateY(-1px);
}

.form-group.focused label {
    color: var(--primary-orange);
}

.form-group.focused .input-icon {
    color: var(--primary-orange);
}

/* Input with Icon Enhanced */
.input-with-icon {
    position: relative;
}

.input-with-icon .form-input {
    padding-right: 40px;
}

/* Enhanced Message States */
.message {
    padding: var(--space-3);
    border-radius: var(--radius-medium);
    border: 1px solid;
    margin: var(--space-4) 0;
    font-size: 14px;
    line-height: 1.4;
    display: none;
    transition: all var(--transition-quick);
}

.message.show {
    display: block;
    animation: slideInDown 0.3s ease-out;
}

/* Responsive Design Enhanced */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        border-radius: 0;
    }
    
    .login-left {
        min-height: 40vh;
        order: 1;
    }
    
    .login-right {
        order: 2;
        padding: var(--space-6);
    }
    
    .login-right::before {
        width: 100%;
        height: 4px;
        top: 0;
        left: 0;
    }
    
    .login-form-container {
        max-width: 100%;
        padding: var(--space-8);
        box-shadow: none;
        border: none;
    }
    
    .quote {
        bottom: var(--space-8);
        left: var(--space-4);
        right: var(--space-4);
    }
    
    .quote p {
        font-size: 20px;
    }
    
    .system-info h1 {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .login-right {
        padding: var(--space-4);
    }
    
    .login-form-container {
        padding: var(--space-6);
    }
    
    .quote {
        bottom: var(--space-6);
        left: var(--space-3);
        right: var(--space-3);
        padding: var(--space-4);
    }
    
    .quote p {
        font-size: 18px;
    }
    
    .system-info h1 {
        font-size: 24px;
    }
    
    .submit-btn {
        font-size: 16px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .login-left {
        background: linear-gradient(135deg, var(--primary-orange-darker), var(--primary-orange-dark));
    }
    
    .overlay {
        background: linear-gradient(
            135deg,
            rgba(255, 165, 0, 0.2) 0%,
            rgba(255, 140, 0, 0.3) 50%,
            rgba(255, 69, 0, 0.4) 100%
        );
    }
    
    .quote {
        background: rgba(255, 255, 255, 0.3);
        border: 1px solid rgba(255, 165, 0, 0.3);
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .form-group input:focus {
        border-width: 3px;
        border-color: var(--primary-orange);
    }
    
    .submit-btn {
        border: 2px solid var(--primary-orange-dark);
    }
}

/* Focus Visible for Keyboard Navigation */
.submit-btn:focus-visible,
.form-group input:focus-visible {
    outline: 3px solid var(--primary-orange);
    outline-offset: 2px;
}

/* Login Button */
.login-button {
    width: 100%;
    padding: var(--space-3) var(--space-6);
    background: var(--primary-orange);
    color: var(--white-pure);
    border: none;
    border-radius: var(--radius-large);
    font-size: 17px;
    font-weight: 500;
    font-family: var(--font-family-text);
    cursor: pointer;
    transition: all var(--transition-quick);
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    letter-spacing: -0.022em;
    box-shadow: var(--shadow-orange);
    position: relative;
    overflow: hidden;
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-smooth);
}

.login-button:hover {
    background: var(--primary-orange-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-orange-heavy);
}

.login-button:hover::before {
    left: 100%;
}

.login-button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-orange);
}

.login-button:disabled {
    background: var(--gray-400);
    cursor: not-allowed;
}

/* Messages */
.error-message {
    background: var(--background-secondary);
    color: var(--system-red);
    padding: var(--space-4);
    border-radius: var(--radius-medium);
    border: 1px solid var(--separator);
    margin-top: var(--space-4);
    font-size: 15px;
    text-align: center;
}

.success-message {
    background: var(--background-secondary);
    color: var(--system-green);
    padding: var(--space-4);
    border-radius: var(--radius-medium);
    border: 1px solid var(--separator);
    margin-top: var(--space-4);
    font-size: 15px;
    text-align: center;
}

/* Loader */
.loader {
    text-align: center;
    padding: var(--space-6);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--separator);
    border-top: 2px solid var(--apple-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* Message States */
.message {
    padding: var(--space-3);
    border-radius: var(--radius-medium);
    border: 1px solid;
    margin: var(--space-4) 0;
    font-size: 14px;
    line-height: 1.4;
    display: none;
}

.message.show {
    display: block;
}

.message.success {
    background: var(--overlay-strong);
    color: var(--system-green);
    border-color: var(--system-green);
}

.message.error {
    background: var(--overlay-strong);
    color: var(--system-red);
    border-color: var(--system-red);
}

/* System Info */
.system-info {
    text-align: center;
    margin-bottom: var(--space-6);
}

.system-info h2 {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: var(--space-2);
    font-family: var(--font-family-display);
}

.system-info p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .login-left {
        height: 200px;
        border-radius: var(--radius-large) var(--radius-large) 0 0;
    }
    
    .login-right {
        border-radius: 0 0 var(--radius-large) var(--radius-large);
        padding: var(--space-8);
    }
    
    .login-form {
        max-width: none;
    }
    
    .login-form-container {
        padding: var(--space-8);
        max-width: none;
        border: none;
        box-shadow: none;
    }
    
    .quote {
        bottom: var(--space-8);
        left: var(--space-6);
        right: var(--space-6);
    }
    
    .quote p {
        font-size: 20px;
    }
    
    .system-info h1 {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .login-left {
        height: 30vh;
    }
    
    .login-right {
        height: 70vh;
        padding: var(--space-4);
    }
    
    .login-form-container {
        padding: var(--space-6);
    }
    
    .quote {
        bottom: var(--space-6);
        left: var(--space-4);
        right: var(--space-4);
    }
    
    .quote p {
        font-size: 18px;
    }
    
    .system-info h1 {
        font-size: 24px;
    }
    
    .system-description {
        font-size: 15px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

*:focus {
    outline: 2px solid var(--apple-blue);
    outline-offset: 2px;
}