:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #0ea5e9;
    --surface: #fff;
    --surface-alt: #f8fafc;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --background: #f1f5f9;
    --card-background: #fff;
    --button-gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 24px rgba(79, 70, 229, 0.1);
    --error: #ef4444;
    --success: #10b981;
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
}

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

body {
    font-family: var(--font);
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    letter-spacing: -0.01em;
    position: relative;
    overflow-x: hidden;
}

.login-container {
    background: var(--card-background);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
    overflow: hidden;
    max-width: 530px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    margin: 50px;
}

.login-header {
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.logo-container {
    margin-bottom: 1.5rem;
}

.login-logo {
    height: 60px;
    width: auto;
}

.login-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 400;
}

.login-form {
    padding: 2.5rem 2rem;
    background: var(--surface);
}

.form-group,
.password-field {
    margin-bottom: 3.1rem;
    position: relative;
}

.form-label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--text-muted);
    background: transparent;
    padding: 0 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 3;
}

.form-control {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-size: 1rem;
    color: var(--text);
    font-weight: 500;
    outline: none;
    height: 3.25rem;
    transition: border-color 0.2s ease;
    position: relative;
    z-index: 1;
}

.with-icon .form-control,
.password-field .form-control {
    padding-right: 2.75rem;
}

.form-control:focus {
    border-color: var(--primary);
}

.form-control:focus+.form-label,
.form-control:not(:placeholder-shown)+.form-label {
    top: -0.75rem;
    left: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    z-index: 4;
}

.form-icon,
.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    z-index: 2;
    transition: all 0.2s ease;
}

.form-icon {
    color: var(--text-muted);
    pointer-events: none;
}

.form-icon svg,
.password-toggle svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.form-group.focused .form-icon,
.form-control:focus~.form-icon,
.form-control:not(:placeholder-shown)~.form-icon {
    color: var(--primary);
}

.form-group.with-error .form-icon,
.password-field.with-error .password-toggle {
    color: var(--error);
}

.password-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.375rem;
    z-index: 3;
}

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

.btn-sign-in {
    width: 100%;
    height: 3.25rem;
    background: var(--button-gradient);
    border: none;
    border-radius: var(--radius-md);
    padding: 0.875rem 1.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-sign-in svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.btn-sign-in:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.form-options {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1.25rem 0 1.75rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.forgot-password {
    color: var(--primary);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: color 0.2s;
}

.forgot-password svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.forgot-password:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.form-group.with-error .form-control,
.password-field.with-error .form-control,
.form-check.with-error .form-check-input {
    border-color: var(--error);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.25);
    background-color: rgba(239, 68, 68, 0.02);
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translateX(-1px);
    }

    20%,
    80% {
        transform: translateX(2px);
    }

    30%,
    50%,
    70% {
        transform: translateX(-2px);
    }

    40%,
    60% {
        transform: translateX(1px);
    }
}

.form-group.with-error .form-label,
.form-check.with-error .form-check-label {
    color: var(--error);
}

.form-error-message {
    color: var(--error);
    font-size: 0.8125rem;
    margin-top: 0.375rem;
    font-weight: 500;
    padding-left: 0.25rem;
    position: absolute;
    bottom: -1.25rem;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s, transform 0.2s;
}

.form-error-message:before {
    content: '';
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: var(--error);
    flex-shrink: 0;
}

.form-group.with-error .form-error-message,
.password-field.with-error .form-error-message,
.form-check.with-error .form-error-message {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.form-check.with-error .form-error-message {
    position: absolute;
    bottom: -1.25rem;
    left: 1.75rem;
    width: calc(100% - 1.75rem);
}

.error-alert,
.success-alert {
    display: none;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.error-alert {
    background-color: rgba(239, 68, 68, 0.08);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.15);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.08);
}

.success-alert {
    background-color: rgba(16, 185, 129, 0.08);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.15);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.08);
}

.error-alert svg,
.success-alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke-width: 2;
}

.error-alert.show,
.success-alert.show {
    display: flex;
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

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

.success-action-container {
    display: none;
    margin-top: 1rem;
}

.success-action-container.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

.separator-text {
    text-align: center;
    position: relative;
    margin: 1.5rem 0;
}

.separator-text span {
    background: var(--surface);
    padding: 0 1rem;
    position: relative;
    z-index: 1;
    color: var(--text-muted);
    font-size: 0.9375rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.separator-text span svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.separator-text::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
    z-index: 0;
}

.badge {
    background-color: #ff9800;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
}

.badge-complete {
    background-color: #28a745;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
}

.demo-accounts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.demo-account {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.demo-account:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.alert-info-demo {
    margin-bottom: 20px;
    border-radius: 8px;
    background-color: rgba(13, 202, 240, 0.15);
    border: 1px solid rgba(13, 202, 240, 0.4);
    padding: 12px;
    font-size: 14px;

}

.alert-icon {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.alert-info-demo svg {
    margin-right: 8px;
    color: #0dcaf0;
}

.alert-info-demo p {
    margin: 0;
    padding: 0;
}

.account-type {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.375rem;
}

.account-details {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-bottom: 0.5rem;
}

.fill-credentials {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.375rem 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.5rem;
    transition: color 0.2s;
}

.fill-credentials svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.fill-credentials:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.fill-credentials:disabled {
    opacity: 0.7;
    cursor: wait;
}

.fill-credentials.filling {
    color: var(--secondary);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1.5s linear infinite;
}

.account-options {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.account-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    margin-left: 0.25rem;
    transition: color 0.2s;
}

.account-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.back-link {
    margin-top: 1.5rem;
    text-align: center;
}

.back-link a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem;
    transition: color 0.2s;
}

.back-link a svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.back-link a:hover {
    color: var(--text);
}

.password-strength-container {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: var(--surface-alt);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.password-strength-container h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.password-strength-meter {
    height: 0.375rem;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.password-strength-meter-bar {
    height: 100%;
    width: 0;
    background: var(--error);
    border-radius: 999px;
    transition: width 0.3s, background-color 0.3s;
}

.password-strength-text {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.password-strength-text span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.password-strength-text span svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.password-strength-text span.active {
    opacity: 1;
    font-weight: 600;
}

.password-requirements-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.password-requirements {
    display: grid;
    gap: 0.5rem;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    transition: color 0.3s;
    margin-bottom: 0.375rem;
}

.requirement:last-child {
    margin-bottom: 0;
}

.requirement svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.3s, stroke 0.3s;
}

.requirement.met {
    color: var(--success);
}

.requirement.met svg {
    opacity: 1;
    stroke: var(--success);
}


/* Responsive */
@media (max-width: 768px) {
    .login-container {
        margin: 1rem;
        border-radius: var(--radius-md);
        max-width: 100%;
    }

    .login-header {
        padding: 2rem 1.5rem 1.5rem;
    }

    .login-title {
        font-size: 1.875rem;
    }

    .login-form {
        padding: 1.5rem;
    }

    .form-control {
        font-size: 16px;
        height: 3rem;
    }

    .btn-sign-in {
        height: 3rem;
        font-size: 1rem;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 1rem 0;
    }

    .login-container {
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
    }

    .login-header {
        padding: 1.5rem 1.25rem;
    }

    .login-form {
        padding: 1.25rem;
    }

    .login-title {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .form-label {
        font-size: 0.9375rem;
    }
}