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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow-x: hidden;
    background-color: #f4f6f9;
    color: #1e2a3a;
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
}

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

.login-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(30, 42, 58, 0.08), 0 1px 3px rgba(30, 42, 58, 0.04);
    padding: 40px 36px 28px;
    animation: slideIn 0.4s ease-out;
}

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

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

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

.logo {
    width: 71px;
    height: 71px;
    margin: 0 auto;
    background-image: url("img/logo-transport.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.login-title {
    font-size: calc(1.25rem - 2px);
    font-weight: 700;
    color: #1e2a4a;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.login-subtitle {
    font-size: 0.9rem;
    color: #6b7c93;
    margin-bottom: 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.45;
}

.login-form {
    margin-top: 0;
}

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

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1e2a4a;
    margin-bottom: 8px;
}

.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa8b8;
    font-size: 1rem;
    pointer-events: none;
    z-index: 2;
}

.input-field {
    width: 100%;
    padding: 11px 14px 11px 42px;
    border: 1px solid #dde3ea;
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #ffffff;
    color: #1e2a3a !important;
}

.input-field-password {
    padding-right: 42px;
}

.input-field:focus {
    outline: none;
    border-color: #3d6cb5;
    box-shadow: 0 0 0 3px rgba(61, 108, 181, 0.12);
    color: #1e2a3a !important;
}

.input-field::placeholder {
    color: #a8b4c2 !important;
}

.input-field:-webkit-autofill,
.input-field:-webkit-autofill:hover,
.input-field:-webkit-autofill:focus {
    -webkit-text-fill-color: #1e2a3a !important;
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    box-shadow: 0 0 0 1000px #ffffff inset !important;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9aa8b8;
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
    z-index: 10;
}

.password-toggle-btn:hover {
    color: #3d6cb5;
}

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

.captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-question {
    flex-shrink: 0;
    min-width: 72px;
    padding: 11px 12px;
    background-color: #f4f6f9;
    border: 1px solid #dde3ea;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #1e2a4a;
    text-align: center;
    user-select: none;
}

.captcha-input {
    flex: 1;
    min-width: 0;
    padding-left: 14px;
    text-align: center;
}

.captcha-input::-webkit-outer-spin-button,
.captcha-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.captcha-input[type="number"] {
    -moz-appearance: textfield;
}

.captcha-refresh-btn {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f4f6f9;
    border: 1px solid #dde3ea;
    border-radius: 8px;
    color: #6b7c93;
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.captcha-refresh-btn:hover:not(:disabled) {
    color: #3d6cb5;
    border-color: #3d6cb5;
    background-color: #ffffff;
}

.captcha-refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.alert {
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    border: none;
    animation: slideDown 0.3s ease-out;
}

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

.alert-danger {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-danger i {
    font-size: 1rem;
    flex-shrink: 0;
}

.login-button {
    width: 100%;
    padding: 12px 24px;
    background-color: #1e2a4a;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-button:hover:not(:disabled) {
    background-color: #162038;
}

.login-button:active:not(:disabled) {
    transform: scale(0.99);
}

.login-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.button-icon {
    transition: transform 0.2s ease;
}

.login-button:hover:not(:disabled) .button-icon {
    transform: translateX(4px);
}

.visually-hidden {
    display: none !important;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px 24px;
        border-radius: 10px;
    }

    .login-title {
        font-size: calc(1.1rem - 2px);
    }

    .logo {
        width: 63px;
        height: 63px;
    }
}
