:root {
    --primary-blue: #4472a8;
    --primary-blue-dark: #365f8c;
    --primary-blue-light: #6b92c7;
    --secondary-blue: #87b3d9;
    --accent-blue: #d6e5f5;
    --gray-50: #ffffff;
    --gray-100: #fdfdfd;
    --gray-200: #f8f9fa;
    --gray-300: #f1f3f4;
    --gray-400: #e8eaed;
    --gray-500: #dadce0;
    --gray-600: #9aa0a6;
    --gray-700: #5f6368;
    --gray-800: #3c4043;
    --gray-900: #202124;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #fdfdfd;
    --bg-accent: #f8f9fa;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-muted: #9aa0a6;
    --border-color: #f1f3f4;
    --border-light: #e8eaed;
    --border-focus: #4472a8;
    --error-color: #d93025;
    --warning-color: #f9ab00;
    --success-color: #137333;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --container-padding: 16px;
    --max-width: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--container-padding);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

input,
textarea {
    user-select: text;
}

.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.page-loader .loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-light);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.main-container {
    width: 100%;
    max-width: var(--max-width);
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 80px;
    align-items: center;
    min-height: 100vh;
    min-height: 100svh;
}

.branding-section {
    padding: 40px 0;
}

.company-logo {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    min-height: 72px;
}

.company-logo img {
    max-height: 72px;
    width: auto;
    object-fit: contain;
}

.company-name {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.company-tagline {
    font-size: clamp(18px, 3vw, 24px);
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 32px;
}

.features-list {
    list-style: none;
    gap: 16px;
    display: flex;
    flex-direction: column;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 16px;
}

.feature-icon {
    width: 24px;
    height: 24px;
    background: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    flex-shrink: 0;
}

.login-section {
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 40px 32px;
    width: 100%;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.login-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--secondary-blue));
}

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

.login-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    line-height: 1.4;
}

.alert-icon {
    font-size: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

.alert-error {
    background: rgba(250, 56, 62, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(250, 56, 62, 0.2);
}

.alert-warning {
    background: rgba(255, 120, 73, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(255, 120, 73, 0.2);
}

.alert-info {
    background: rgba(68, 114, 168, 0.1);
    color: var(--primary-blue);
    border: 1px solid rgba(68, 114, 168, 0.2);
}

.form-group {
    margin-bottom: 20px;
}

.form-group:last-of-type {
    margin-bottom: 28px;
}

.input-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

.input-field {
    width: 100%;
    height: 56px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0 20px;
    font-size: 16px;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
    appearance: none;
}

.input-field:focus {
    border-color: var(--border-focus);
    background: var(--bg-primary);
    box-shadow: 0 0 0 2px rgba(68, 114, 168, 0.1);
}

.input-field::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.input-field:disabled {
    background: var(--gray-100);
    border-color: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary-blue);
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    min-width: 70px;
    text-align: center;
    touch-action: manipulation;
}

.password-toggle:hover,
.password-toggle:focus {
    background: rgba(24, 119, 242, 0.1);
}

.submit-btn {
    width: 100%;
    height: 56px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 20px;
    outline: none;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
    appearance: none;
}

.submit-btn:hover:not(:disabled) {
    background: var(--primary-blue-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.forgot-link {
    text-align: center;
    margin-bottom: 24px;
}

.forgot-link a {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 8px 16px;
    border-radius: 6px;
    display: inline-block;
}

.forgot-link a:hover {
    background: rgba(24, 119, 242, 0.1);
    text-decoration: underline;
}

.security-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.security-info-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.footer-links {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
    padding: 4px 8px;
    border-radius: 4px;
}

.footer-links a:hover {
    color: var(--primary-blue);
    background: rgba(24, 119, 242, 0.1);
}

.slide-up {
    animation: slideUp 0.6s ease-out forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 40px;
        max-width: 500px;
        margin: 0 auto;
    }

    .branding-section {
        text-align: center;
        order: 1;
        padding: 20px 0;
    }

    .login-section {
        order: 2;
    }

    .features-list {
        display: none;
    }
}

@media (max-width: 768px) {
    :root {
        --container-padding: 12px;
    }

    body {
        align-items: flex-start;
        padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    }

    .main-container {
        min-height: auto;
        gap: 24px;
        width: 100%;
        max-width: none;
        margin: 0;
    }

    .login-section {
        padding: 32px 24px;
        margin-top: 0;
        border-radius: 16px;
    }

    .input-field,
    .submit-btn {
        height: 52px;
        font-size: 16px;
    }

    .company-name {
        font-size: 28px;
    }

    .company-tagline {
        display: none;
    }

    .branding-section {
        padding: 20px 0 0 0;
        margin-bottom: 24px;
    }

    .company-logo {
        justify-content: center;
        margin-bottom: 0;
    }

    .company-logo img {
        max-height: 72px;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}