/* Authentication pages share tokens, controls and motion with the rest of the plugin. */

body.uap-fullpage-body,
body.uap-fullpage-body * {
    box-sizing: border-box;
}

body.uap-fullpage-body {
    margin: 0;
    color: var(--uap-text);
    background: var(--uap-bg);
    font-family: var(--uap-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.uap-fullpage-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
    background: var(--uap-bg);
    background-position: center;
    background-size: cover;
}

/* A site-provided background image stays; the overlay keeps the form readable. */
.uap-fullpage-wrapper.has-background {
    background-color: #0f172a;
}

.uap-fullpage-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
}

.uap-fullpage-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
}

.uap-form-container {
    width: 100%;
    max-width: 420px;
    padding: 36px 32px;
    border: 1px solid var(--uap-border);
    border-radius: var(--uap-radius-md);
    background: var(--uap-surface);
}

.uap-form-title {
    margin: 0 0 24px;
    color: var(--uap-text);
    font-size: var(--uap-text-2xl);
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    letter-spacing: -0.02em;
}

.uap-form-desc {
    margin: -12px 0 24px;
    color: var(--uap-text-muted);
    font-size: var(--uap-text-base);
    line-height: 1.5;
    text-align: center;
}

.uap-field {
    margin: 0 0 16px;
}

.uap-field label {
    display: block;
    margin: 0 0 6px;
    color: var(--uap-text);
    font-size: var(--uap-text-sm);
    font-weight: 600;
}

.uap-field label .required {
    color: var(--uap-error);
}

.uap-input,
input.uap-input {
    display: block;
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--uap-border);
    border-radius: var(--uap-radius-sm);
    outline: 0;
    background: var(--uap-surface);
    color: var(--uap-text);
    font: inherit;
    font-size: var(--uap-text-base);
    font-weight: 400;
    box-shadow: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    box-sizing: border-box;
}

.uap-input:hover {
    border-color: var(--uap-border-hover);
}

.uap-input:focus {
    border-color: var(--uap-action-bg);
    box-shadow: none;
}

.uap-input.error {
    border-color: var(--uap-error);
    background: var(--uap-error-bg);
}

.uap-input.success {
    border-color: var(--uap-success);
    background: var(--uap-success-bg);
}

.uap-field-hint {
    display: block;
    margin-top: 5px;
    color: var(--uap-text-light);
    font-size: var(--uap-text-xs);
    line-height: 1.4;
}

.uap-field-hint:empty {
    display: none;
}

.uap-field-hint.error {
    color: var(--uap-error);
}

.uap-field-hint.success {
    color: var(--uap-success);
}

.uap-checkbox-field label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: var(--uap-text-sm);
    font-weight: 500;
    color: var(--uap-text-muted);
    cursor: pointer;
    user-select: none;
}

.uap-checkbox-field input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--uap-action-bg);
    border-radius: 4px;
    cursor: pointer;
}

.uap-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 24px;
    border: 1px solid transparent;
    border-radius: var(--uap-radius-sm);
    font: inherit;
    font-size: var(--uap-text-base);
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
    position: relative;
    overflow: hidden;
}

.uap-button-primary {
    background: var(--uap-action-bg, #0e7a6d);
    color: #ffffff !important;
    box-shadow: none;
}

.uap-button-primary:hover {
    background: var(--uap-action-hover, #0b6359);
    color: #ffffff !important;
}

.uap-button-primary:active {
    transform: scale(0.98);
}

.uap-button-block {
    width: 100%;
}

.uap-button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    transform: none !important;
    box-shadow: none !important;
    background: var(--uap-border) !important;
    color: var(--uap-text-muted) !important;
}

.uap-button .spinner {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: uap-auth-spin 0.7s linear infinite;
}

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

/* Message text keeps darker shades than the status tokens so small text stays readable. */
.uap-message {
    display: none;
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: var(--uap-radius-sm);
    font-size: var(--uap-text-sm);
    font-weight: 500;
    line-height: 1.5;
}

.uap-message.success {
    border-color: rgba(var(--uap-success-rgb), 0.3);
    background: var(--uap-success-bg);
    color: #047857;
}

.uap-message.error {
    border-color: rgba(var(--uap-error-rgb), 0.3);
    background: var(--uap-error-bg);
    color: #b91c1c;
}

.uap-message.warning {
    border-color: rgba(var(--uap-warning-rgb), 0.35);
    background: var(--uap-warning-bg);
    color: #92400e;
}

.uap-message a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
}

.uap-form-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 20px;
    margin-top: 24px;
    font-size: var(--uap-text-sm);
}

.uap-form-links a {
    color: var(--uap-action-bg, #0e7a6d);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.uap-form-links a:hover {
    color: var(--uap-action-hover, #0b6359);
    text-decoration: underline;
}

.uap-social-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 16px;
    color: var(--uap-text-light);
    font-size: var(--uap-text-sm);
    font-weight: 500;
}

.uap-social-divider::before,
.uap-social-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--uap-border-light);
}

.uap-social-divider span {
    white-space: nowrap;
}

.uap-social-login-title {
    display: none;
}

.uap-social-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.uap-social-btn {
    display: inline-flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-height: 0;
    padding: 0;
    border: 1px solid var(--uap-border);
    border-radius: 50%;
    background: var(--uap-surface);
    color: var(--uap-text);
    text-decoration: none;
    box-shadow: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.uap-social-btn:hover {
    border-color: var(--uap-border-hover);
    background: var(--uap-surface-hover);
    color: var(--uap-text);
}

.uap-social-btn img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.uap-password-wrap {
    position: relative;
}

.uap-password-wrap .uap-input {
    padding-right: 48px;
}

.uap-password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--uap-radius-sm);
    outline: 0;
    background: transparent;
    color: var(--uap-text-light);
    cursor: pointer;
    transform: translateY(-50%);
    transition: color 0.15s ease, background-color 0.15s ease;
}

.uap-password-toggle:hover {
    background: var(--uap-surface-hover);
    color: var(--uap-text);
}

.uap-password-toggle svg {
    display: block;
    width: 18px;
    height: 18px;
}

@media (max-width: 600px) {
    .uap-fullpage-wrapper {
        align-items: flex-start;
        padding: 24px 14px;
    }

    .uap-fullpage-content {
        max-width: 100%;
    }

    .uap-form-container {
        padding: 28px 20px;
    }

    .uap-form-title {
        margin-bottom: 20px;
        font-size: var(--uap-text-xl);
    }

    .uap-social-buttons {
        gap: 10px;
    }
}
