/**
 * OTP LoginPress front-end base styling.
 * Keep the layout simple so it matches the default look across all supported platforms.
 */

:root {
    --otp-loginpress-font: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --otp-loginpress-border: #e5e7eb;
    --otp-loginpress-muted: #6b7280;
    --otp-loginpress-primary: #0eae57;
    --otp-loginpress-background: #ffffff;
    --otp-loginpress-radius: 8px;
    --otp-loginpress-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    --s-loader-border-color-trans: rgba(14, 174, 87, 0.2);
    --s-loader-border-color-full: rgba(14, 174, 87, 1);
    --s-loader-width: 22px;
    --s-loader-height: var(--s-loader-width);
}

.ui.whatsapp[otp_loginpress="section"] {
    max-width: 520px;
    margin: 3rem auto;
    padding: 0 1.5rem;
    font-family: var(--otp-loginpress-font);
    color: #111827;
}

.otp-loginpress-panel {
    background: var(--otp-loginpress-background);
    border: 1px solid var(--otp-loginpress-border);
    border-radius: var(--otp-loginpress-radius);
    padding: 32px 28px;
    box-shadow: var(--otp-loginpress-shadow);
}

body.login .otp-loginpress-panel {
    border: none;
    box-shadow: none;
    padding: 0;
}

.otp-loginpress-heading {
    margin: 0 0 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.otp-loginpress-heading-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--otp-loginpress-primary);
    background: rgba(14, 174, 87, 0.12);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.otp-loginpress-heading-title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.otp-loginpress-heading-subtitle {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--otp-loginpress-muted);
}

.otp-loginpress-fields {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.otp-loginpress-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.otp-loginpress-label {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
}

.otp-loginpress-input {
    position: relative;
}

.otp-loginpress-input input {
    width: 100%;
    padding: 0.75rem 0.875rem 0.75rem 2.75rem;
    border-radius: 6px;
    border: 1px solid var(--otp-loginpress-border);
    font-size: 15px;
    color: #111827;
    background-color: #f9fafb;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.otp-loginpress-input input:focus {
    outline: none;
    border-color: var(--otp-loginpress-primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(14, 174, 87, 0.18);
}

.otp-loginpress-input input::placeholder {
    color: rgba(107, 114, 128, 0.8);
}

.otp-loginpress-icon,
.field-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: rgba(107, 114, 128, 0.85);
    pointer-events: none;
}

.otp-loginpress-helper {
    font-size: 13px;
    line-height: 1.5;
    color: var(--otp-loginpress-muted);
}

.otp-loginpress-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 28px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--otp-loginpress-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

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

.otp_loginpress-custom-color,
.otp_loginpress-custom-color.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border-radius: 6px;
    border: 1px solid var(--otp-loginpress-primary);
    background-color: var(--otp-loginpress-primary);
    color: #ffffff;
    font-weight: 600;
    padding: 0.9rem 1rem;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.otp_loginpress-custom-color:hover {
    background-color: #0d9b4f;
}

.otp_loginpress-custom-color-invert {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border-radius: 6px;
    border: 1px solid var(--otp-loginpress-border);
    color: #1f2937;
    padding: 0.85rem 1rem;
    background-color: #ffffff;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.otp_loginpress-custom-color-invert:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.confirm_passkey {
    display: none;
}

.confirm_passkey .ui.confirm {
    display: flex;
    gap: 8px;
}

.confirm_passkey .ui.confirm input {
    width: 100%;
    max-width: 46px;
    padding: 0.6rem 0;
    text-align: center;
}

.spinning-loader {
    display: none;
    margin: 16px auto 0;
    border: 3px solid var(--s-loader-border-color-trans);
    border-top-color: var(--s-loader-border-color-full);
    border-radius: 50%;
    width: var(--s-loader-width);
    height: var(--s-loader-height);
    animation: otp-loginpress-spin 0.6s linear infinite;
}

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

ul.response {
    margin: 16px 0 0;
    padding: 12px 16px;
    list-style: none;
    border-radius: 6px;
    background: rgba(14, 174, 87, 0.1);
    color: #065f46;
    font-size: 14px;
}

ul.response li {
    margin: 0;
    padding: 0;
}

.ui.segment {
    border: 1px solid var(--otp-loginpress-border);
    border-radius: 6px;
    padding: 0.75rem;
    background-color: #ffffff;
}

.otp-loginpress-panel .ui.form .field.error input {
    border-color: #dc2626 !important;
    background-color: rgba(220, 38, 38, 0.07);
}

.otp-loginpress-panel .ui.form .message.error {
    border-radius: 6px;
    border-left: 3px solid #dc2626;
    background: rgba(220, 38, 38, 0.07);
    color: #991b1b;
}

.page-loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.page-loader .spinning-loader {
    display: block;
}

@media (max-width: 600px) {
    .ui.whatsapp[otp_loginpress="section"] {
        margin: 2rem auto;
        padding: 0 1rem;
    }

    .otp-loginpress-panel {
        padding: 24px 20px;
    }
}
