/* ─────────────────────────────────────────────────────────────
 * IPA Core Auth - Login & Password Reset
 * ───────────────────────────────────────────────────────────── */

.ipa-auth {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 16px;
}

.ipa-form.ipa-auth__login-form,
.ipa-form.ipa-auth__reset-request-form {
    background: var(--ipa-bg-alt, #f2f4f7);
    border: 1px solid var(--ipa-border, #e3e7f0);
}

.ipa-auth__card {
    background: var(--ipa-bg, #fff);
    border-radius: 12px;
    box-shadow: var(--ipa-shadow, 0 0.04rem 0.08rem rgba(0,0,0,0.1), 0 0.13rem 0.4rem rgba(0,0,0,0.1));
    width: 100%;
    max-width: 420px;
}

.ipa-auth__header {
    text-align: center;
    padding: 32px 32px 0;
}

.ipa-auth__logo {
    width: 250px;
    border-radius: 5px;
    margin-bottom: 16px;
}

.ipa-auth__header h2 {
    font-size: calc(var(--ipa-fs, var(--font-size, 14px)) * 1.5714);
    font-weight: 600;
    color: var(--ipa-text, #303640);
    margin: 0 0 4px;
}

.ipa-auth__body {
    padding: 24px 32px 32px;
}

/* Forma jau kortelėje - be bendro .ipa-form (components/forms.css) fono, šešėlio ir tarpų, kad nebūtų „kortelės kortelėje" */
.ipa-auth .ipa-form {
    background: none;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin: 0;
}

.ipa-auth__footer {
    padding: 0 32px 24px;
    text-align: center;
}

.ipa-auth__footer a {
    color: var(--ipa-text-light, #5a6a85);
    font-size: calc(var(--ipa-fs, var(--font-size, 14px)) * 1);
    text-decoration: none;
}

.ipa-auth__footer a:hover {
    color: var(--ipa-secondary, #28ba99);
}

/* Messages */
.ipa-auth__message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: calc(var(--ipa-fs, var(--font-size, 14px)) * 1);
    margin-bottom: 16px;
    line-height: 1.5;
}

.ipa-auth__message--warning {
    background: var(--ipa-warning-bg, #fff3cd);
    border: 1px solid var(--ipa-warning-border, #ffeaa7);
    color: var(--ipa-warning-text, #856404);
}

.ipa-auth__message--success {
    background: var(--ipa-success-bg, #d4edda);
    border: 1px solid var(--ipa-success-border, #c3e6cb);
    color: var(--ipa-success-text, #155724);
}

.ipa-auth__message--error {
    background: var(--ipa-danger-bg, #f8d7da);
    border: 1px solid var(--ipa-danger-border, #f5c6cb);
    color: var(--ipa-danger-text, #721c24);
}

.ipa-auth__description {
    font-size: calc(var(--ipa-fs, var(--font-size, 14px)) * 1);
    color: var(--ipa-text-light, #5a6a85);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Form Fields */
.ipa-auth .ipa-form__field {
    margin-bottom: 16px;
}

.ipa-auth .ipa-form__label {
    display: block;
    font-size: calc(var(--ipa-fs, var(--font-size, 14px)) * 1);
    font-weight: 500;
    color: var(--ipa-text, #303640);
    margin-bottom: 6px;
}

.ipa-auth .ipa-form__input-wrapper {
    position: relative;
}

.ipa-auth .ipa-input {
    width: 100%;
    font-size: inherit;
    border: 1px solid var(--ipa-border, #e3e7f0);
    border-radius: 4px;
    /* Laukas atskiriamas nuo baltos kortelės švelniu fonu; aktyvus - baltas */
    background: color-mix(in srgb, var(--ipa-bg-alt, #f2f4f7) 65%, var(--ipa-bg, #fff));
    color: var(--ipa-text, #303640);
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
    box-sizing: border-box;
}

.ipa-auth .ipa-input:focus {
    outline: none;
    background: var(--ipa-bg, #fff);
    border-color: var(--ipa-secondary, #28ba99);
    box-shadow: 0 0 0 3px rgba(40, 186, 153, 0.12);
}

/* Password toggle */
.ipa-auth .ipa-form__input-wrapper--password .ipa-input {
    padding-right: 42px;
}

.ipa-auth .ipa-form__password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--ipa-text-light, #5a6a85);
    font-size: calc(var(--ipa-fs, var(--font-size, 14px)) * 1.1429);
    line-height: 1;
}

.ipa-auth .ipa-form__password-toggle:hover {
    color: var(--ipa-text, #303640);
}

.ipa-auth .ipa-input[readonly] {
    background: var(--ipa-bg-alt, #f2f4f7);
    color: var(--ipa-text-light, #5a6a85);
    cursor: not-allowed;
}

/* Validation Errors */
.ipa-form__error {
    color: var(--ipa-danger, #dc3545);
    font-size: calc(var(--ipa-fs, var(--font-size, 14px)) * 0.9286);
    margin-top: 4px;
}

/* Options (remember + forgot) */
.ipa-auth__options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: calc(var(--ipa-fs, var(--font-size, 14px)) * 1);
}

.ipa-auth__remember {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--ipa-text, #303640);
}

.ipa-auth__remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--ipa-secondary, #28ba99);
}

/* Forgot password link */
.ipa-auth__forgot-link {
    font-size: calc(var(--ipa-fs, var(--font-size, 14px)) * 1);
    color: var(--ipa-secondary, #28ba99);
    text-decoration: none;
}

.ipa-auth__forgot-link:hover {
    text-decoration: underline;
}

/* Links section */
.ipa-auth__links {
    text-align: center;
    margin-top: 20px;
    font-size: calc(var(--ipa-fs, var(--font-size, 14px)) * 1);
}

.ipa-auth__links a {
    color: var(--ipa-secondary, #28ba99);
    text-decoration: none;
}

.ipa-auth__links a:hover {
    text-decoration: underline;
}

/* Buttons */
.ipa-form__actions {
    margin-top: 8px;
}

.ipa-auth .ipa-btn--primary {
    background: var(--ipa-secondary, #28ba99);
    color: #fff;
    width: 100%;
}

.ipa-auth .ipa-btn--primary:hover {
    background: var(--ipa-primary, #2a646f);
}

.ipa-auth .ipa-btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Spinner */
.ipa-auth__spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ipa-spin 0.6s linear infinite;
}

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

/* Responsive */
@media (max-width: 480px) {
    .ipa-auth {
        padding: 20px 12px;
    }
    .ipa-auth__header,
    .ipa-auth__body,
    .ipa-auth__footer {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Logotipas tamsiai temai (Auth::logo_html): Impreza .us-color-scheme-on */
.ipa-logo--dark { display: none !important; }
.us-color-scheme-on .ipa-logo--light { display: none !important; }
.us-color-scheme-on .ipa-logo--dark { display: block !important; }
