/**
 * ISC License
 *
 * Copyright (c) 2026 idnovate.com
 * idnovate is a Registered Trademark & Property of idnovate.com, innovación y desarrollo SCP
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 *
 * @author    idnovate
 * @copyright 2026 idnovate.com
 * @license   https://www.isc.org/licenses/ https://opensource.org/licenses/ISC ISC License
 */

/* loginotp — front-office styles */

/* Intro text shown above the email field in OTP-only mode */
.loginotp-intro {
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
    color: #6c757d;
}

#loginotp-panel {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 10px 0 30px;
}

/* Prevent flicker before JS transforms the login form */
#login-form .form-group:has(input[type="password"]),
#login-form .mb-3:has(input[type="password"]) {
    display: none !important;
}

#login-form [type="submit"] {
    display: none !important;
}

/* OTP-only email step: present it as a clean, centered column so the label,
   field and "Send login code" button are all centered — matching the code step.
   Overrides the theme's horizontal label/field layout only on the login form. */
#login-form .form-group.row {
    display: block;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

#login-form .form-group.row label.form-control-label {
    display: block;
    width: 100%;
    max-width: 100%;
    float: none;
    text-align: center;
    margin: 0 0 8px;
    padding: 0;
}

#login-form .form-group.row .js-input-column,
#login-form .form-group.row [class*="col-"] {
    display: block;
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
    float: none;
    padding: 0;
}

#login-form .form-footer {
    text-align: center;
}

#login-form #loginotp-send-btn {
    display: inline-block;
    float: none;
    margin: 6px auto 0;
}

#login-form .forgot-password,
#login-form .login__forgot-password,
#login-form [href*="password-recovery"],
#login-form [href*="forgot"] {
    display: none !important;
}

/* Code step: some themes do not style Bootstrap's .text-center utility, which
   left-aligns the "Sign in" button while the digit boxes stay centered. Center the
   panel's action buttons explicitly so they line up under the code inputs. */
#loginotp-panel .text-center {
    text-align: center;
    margin-top: 22px;
    margin-bottom: 18px;
}

#loginotp-panel #loginotp-verify-btn,
#loginotp-panel #loginotp-resend-btn {
    display: inline-block;
    float: none;
    margin-left: auto;
    margin-right: auto;
}

#loginotp-panel #loginotp-resend-btn {
    display: block;
    margin-top: 12px;
}

/* Digit input grid */
.loginotp-digits {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.loginotp-digits-group {
    display: flex;
    gap: 8px;
}

.loginotp-sep {
    font-size: 22px;
    color: #aaa;
    margin: 0 4px;
    line-height: 1;
    align-self: center;
}

.loginotp-digit {
    width: 48px;
    height: 56px;
    border: 2px solid #ccc;
    border-radius: 6px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    color: #222;
    background: #fff;
    outline: none;
    transition: border-color 0.15s ease;
    -moz-appearance: textfield;
    padding: 0;
}

.loginotp-digit::-webkit-inner-spin-button,
.loginotp-digit::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.loginotp-digit:focus {
    border-color: #25b9d7;
    box-shadow: 0 0 0 3px rgba(37, 185, 215, 0.15);
}

.loginotp-digit.is-filled {
    border-color: #25b9d7;
}

/* Responsive: smaller screens */
@media (max-width: 400px) {
    .loginotp-digit {
        width: 38px;
        height: 46px;
        font-size: 20px;
    }

    .loginotp-digits {
        gap: 4px;
    }

    .loginotp-digits-group {
        gap: 4px;
    }
}
