/**
 * Amelia Password Registration v2.0 - Styles
 *
 * Tre modalità: Registrazione, Login, Reset Password.
 * Usa la struttura Element Plus di Amelia (el-form-item, el-input, etc).
 * Questo CSS gestisce gli elementi aggiuntivi del plugin.
 */

/* ========================
   Wrapper principale
   ======================== */
.amelia-pwd-reg-wrapper {
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========================
   Toggle visibilità (occhio)
   ======================== */
.amelia-pwd-reg-field .el-input__wrapper {
    position: relative;
}

.amelia-pwd-reg-field .el-input__inner {
    padding-right: 36px !important;
}

.amelia-pwd-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none !important;
    border: none !important;
    cursor: pointer;
    padding: 4px;
    color: var(--am-c-inp-placeholder, #595959);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    z-index: 2;
    line-height: 1;
    margin: 0;
    outline: none;
    box-shadow: none !important;
}

.amelia-pwd-toggle:hover,
.amelia-pwd-toggle:focus {
    color: var(--am-c-inp-text, #000000);
    background: none !important;
    box-shadow: none !important;
}

.amelia-pwd-toggle svg {
    pointer-events: none;
    display: block;
}

/* ========================
   Indicatore forza password
   ======================== */
.amelia-pwd-strength {
    margin: 4px 0 0 0;
    padding: 0 2px;
    font-family: "Amelia Montserrat", Montserrat, sans-serif;
    font-size: 12px;
    font-weight: 500;
    min-height: 18px;
    line-height: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.amelia-pwd-bar {
    display: inline-block;
    height: 4px;
    border-radius: 2px;
    vertical-align: middle;
    transition: background-color 0.3s ease, width 0.3s ease;
}

.amelia-pwd-strength.weak { color: #e53935; }
.amelia-pwd-strength.weak .amelia-pwd-bar { background: #e53935; width: 30px; }

.amelia-pwd-strength.medium { color: #fb8c00; }
.amelia-pwd-strength.medium .amelia-pwd-bar { background: #fb8c00; width: 45px; }

.amelia-pwd-strength.strong { color: #43a047; }
.amelia-pwd-strength.strong .amelia-pwd-bar { background: #43a047; width: 60px; }

/* ========================
   Corrispondenza password
   ======================== */
.amelia-pwd-match {
    margin: 4px 0 0 0;
    padding: 0 2px;
    font-family: "Amelia Montserrat", Montserrat, sans-serif;
    font-size: 12px;
    font-weight: 500;
    min-height: 18px;
    line-height: 18px;
}

.amelia-pwd-match.match { color: #43a047; }
.amelia-pwd-match.nomatch { color: #e53935; }

/* ========================
   Messaggi di stato
   ======================== */
.amelia-pwd-login-msg,
.amelia-pwd-reset-msg {
    margin: 6px 0 0 0;
    padding: 0 2px;
    font-family: "Amelia Montserrat", Montserrat, sans-serif;
    font-size: 13px;
    font-weight: 500;
    min-height: 20px;
    line-height: 20px;
}

.amelia-msg-ok {
    color: #43a047;
}

.amelia-msg-err {
    color: #e53935;
}

/* ========================
   Messaggio errore (box)
   ======================== */
.amelia-pwd-error {
    background: #fff3f3;
    border: 1px solid #ffcdd2;
    border-radius: 6px;
    padding: 8px 12px;
    font-family: "Amelia Montserrat", Montserrat, sans-serif;
    font-size: 13px;
    color: #c62828;
    margin-top: 8px;
    line-height: 1.4;
}

/* ========================
   Link "Password dimenticata?"
   ======================== */
.amelia-pwd-forgot {
    display: inline-block;
    margin-top: 6px;
    font-family: "Amelia Montserrat", Montserrat, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--am-c-inp-text-op60, rgba(0, 0, 0, 0.6));
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.amelia-pwd-forgot:hover {
    color: var(--am-c-inp-text, #000000);
    text-decoration: underline;
}

/* ========================
   RESET PASSWORD
   ======================== */

/* Titolo sezione reset */
.amelia-pwd-reset-info {
    font-family: "Amelia Montserrat", Montserrat, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--am-c-inp-text, #000000);
    margin-bottom: 4px;
    padding: 0 2px;
}

/* Messaggio "Codice inviato" */
.amelia-pwd-reset-sent {
    font-family: "Amelia Montserrat", Montserrat, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #43a047;
    padding: 6px 12px;
    margin-bottom: 4px;
    background: #f1f8f1;
    border-radius: 6px;
    border: 1px solid #c8e6c9;
}

/* Pulsante "Reimposta Password" */
.amelia-pwd-reset-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    margin-top: 8px;
    font-family: "Amelia Montserrat", Montserrat, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background: #1A84EE;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.amelia-pwd-reset-btn:hover {
    background: #1570cc;
}

.amelia-pwd-reset-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Link "Torna al login" */
.amelia-pwd-back-login {
    display: inline-block;
    margin-top: 8px;
    font-family: "Amelia Montserrat", Montserrat, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--am-c-inp-text-op60, rgba(0, 0, 0, 0.6));
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.amelia-pwd-back-login:hover {
    color: var(--am-c-inp-text, #000000);
    text-decoration: underline;
}

/* ========================
   WebView / Mobile
   ======================== */
@media (max-width: 768px) {
    .amelia-pwd-reg-field .el-input__inner {
        font-size: 16px !important; /* Previene zoom su iOS */
    }

    .amelia-pwd-toggle {
        padding: 8px;
    }

    .amelia-pwd-reset-btn {
        padding: 12px 16px;
        font-size: 15px;
    }
}

/* ========================
   Nascondi se utente loggato
   ======================== */
.logged-in .amelia-pwd-reg-wrapper {
    display: none !important;
}
