/* 
 * Stile personalizzato unificato per la pagina di login/registrazione WooCommerce
 * Versione: 4.0
 * Data: 10 giugno 2025
 */

/* ================ VARIABILI ================ */
:root {
    --rilegato-primary: #FF7150;
    --rilegato-dark: var(--mf-dark-color, #000);
    --rilegato-light: var(--mf-light-color, #fff);
    --rilegato-gray: #f5f5f5;
    --rilegato-text: #333;
    --rilegato-text-light: #777;
    --rilegato-border: #e0e0e0;
    --rilegato-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --rilegato-radius: 8px;
    --rilegato-transition: all 0.3s ease;
    --rilegato-error: #e53935;
    --rilegato-success: #43a047;
}

/* ================ RESET ================ */
.rilegato-account-wrapper *,
.rilegato-account-wrapper *::before,
.rilegato-account-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ================ LAYOUT PRINCIPALE ================ */
.rilegato-account-wrapper {
    max-width: 980px;
    margin: 60px auto;
    font-family: var(--main-font, 'Poppins', sans-serif);
    color: var(--rilegato-text);
    background: var(--rilegato-light);
    border-radius: var(--rilegato-radius);
    box-shadow: var(--rilegato-shadow);
    overflow: hidden;
    position: relative;
}

/* ================ TABS NAVIGATION ================ */
.rilegato-account-tabs,
.customer-login .tabs-nav {
    display: flex;
    background: var(--rilegato-gray);
    border-bottom: 1px solid var(--rilegato-border);
}

.rilegato-account-tabs .tab-link,
.rilegato-account-tab,
.customer-login .tabs-nav a {
    padding: 20px 30px;
    font-size: 16px;
    font-weight: 600;
    color: var(--rilegato-text-light);
    cursor: pointer;
    transition: var(--rilegato-transition);
    text-align: center;
    flex: 1;
    position: relative;
    user-select: none;
    text-decoration: none;
}

.rilegato-account-tabs .tab-link.active,
.rilegato-account-tab.active,
.customer-login .tabs-nav a.active {
    color: var(--rilegato-primary);
    background: var(--rilegato-light);
}

.rilegato-account-tabs .tab-link.active::after,
.rilegato-account-tab.active::after,
.customer-login .tabs-nav a.active:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--rilegato-primary);
    transition: var(--rilegato-transition);
}

/* ================ FORM CONTAINER ================ */
.rilegato-account-panels,
.customer-login .tabs-content {
    padding: 40px;
}

.rilegato-account-panel,
.account-panel,
.customer-login .tabs-panel {
    display: none;
}

.rilegato-account-panel.active,
.account-panel.active,
.customer-login .tabs-panel.active {
    display: block;
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================ TITOLI E TESTO ================ */
.rilegato-account-title,
.panel-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--rilegato-dark);
}

.rilegato-account-subtitle,
.panel-subtitle {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
    color: var(--rilegato-text-light);
}

/* Header dei pannelli */
.panel-header {
    margin-bottom: 30px;
    text-align: center;
}

/* ================ FORM ELEMENTS ================ */
.rilegato-form-row,
.form-group,
.woocommerce-form-row {
    margin-bottom: 20px;
}

.rilegato-form-row label,
.form-group label,
.woocommerce-form-row label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--rilegato-text);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-wrapper .password-input {
    width: 100%;
}

.input-wrapper .password-input .show-password-input {
    display: none !important;
}

.rilegato-form-row .input-text,
.input-wrapper .input-text,
.input-wrapper input[type="text"],
.input-wrapper input[type="email"],
.input-wrapper input[type="password"],
.woocommerce-form-row .woocommerce-Input,
.woocommerce-form-row .input-text {
    width: 100%;
    padding: 12px 15px;
    font-size: 14px;
    color: var(--rilegato-text);
    border: 1px solid var(--rilegato-border);
    border-radius: var(--rilegato-radius);
    background: var(--rilegato-light);
    transition: var(--rilegato-transition);
    height: 50px;
}

.rilegato-form-row .input-text:focus,
.input-wrapper .input-text:focus,
.input-wrapper input[type="text"]:focus,
.input-wrapper input[type="email"]:focus,
.input-wrapper input[type="password"]:focus,
.woocommerce-form-row .woocommerce-Input:focus,
.woocommerce-form-row .input-text:focus {
    border-color: var(--rilegato-primary);
    box-shadow: 0 0 0 3px rgba(255, 113, 80, 0.1);
    outline: none;
}

.rilegato-form-row .input-text::placeholder,
.input-wrapper .input-text::placeholder,
.input-wrapper input::placeholder {
    color: var(--rilegato-text-light);
    opacity: 0.6;
}

/* Input icons */
.input-wrapper .input-icon {
    position: absolute;
    left: 15px;
    color: var(--rilegato-text-light);
}

/* ================ PASSWORD TOGGLE ================ */
.toggle-password,
.password-toggle-icon {
    position: absolute;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--rilegato-text-light);
    cursor: pointer;
    transition: var(--rilegato-transition);
}

.toggle-password:hover,
.password-toggle-icon:hover {
    color: var(--rilegato-primary);
}

/* ================ CHECKBOX ================ */
.rilegato-checkbox-row,
.form-remember,
.woocommerce-form-row__remember {
    display: flex;
    align-items: flex-start;
    margin: 20px 0 30px;
}

.rilegato-checkbox-row input[type="checkbox"],
.form-remember input[type="checkbox"] {
    margin-right: 8px;
}

.rilegato-checkbox-row .checkbox-label,
.form-remember .woocommerce-form__label-for-checkbox span {
    position: relative;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    user-select: none;
    color: var(--rilegato-text);
}

/* Custom checkbox styling */
.rilegato-account-wrapper input[type="checkbox"] {
    position: relative;
    width: 18px;
    height: 18px;
    appearance: none;
    border: 1px solid var(--rilegato-border);
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: middle;
    transition: var(--rilegato-transition);
}

.rilegato-account-wrapper input[type="checkbox"]:checked {
    background-color: var(--rilegato-primary);
    border-color: var(--rilegato-primary);
}

.rilegato-account-wrapper input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--rilegato-light);
    font-size: 12px;
}

/* ================ FORM ACTIONS ================ */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

/* ================ PASSWORD RECOVERY ================ */
.rilegato-lost-password,
.lost-password,
.woocommerce-LostPassword {
    font-size: 14px;
    color: var(--rilegato-text-light);
    text-decoration: none;
    transition: var(--rilegato-transition);
}

.rilegato-lost-password a,
.lost-password,
.woocommerce-LostPassword a {
    color: var(--rilegato-text-light);
    text-decoration: none;
    transition: var(--rilegato-transition);
}

.rilegato-lost-password a:hover,
.lost-password:hover,
.woocommerce-LostPassword a:hover {
    color: var(--rilegato-primary);
}

/* ================ BUTTONS ================ */
.rilegato-button,
.woocommerce-Button.button,
.woocommerce-form-row .woocommerce-button {
    display: inline-block;
    background: var(--rilegato-primary);
    color: var(--rilegato-light);
    border: none;
    border-radius: var(--rilegato-radius);
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--rilegato-transition);
    text-align: center;
    width: 100%;
}

.rilegato-button:hover,
.woocommerce-Button.button:hover,
.woocommerce-form-row .woocommerce-button:hover {
    background: #ff5b36;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 113, 80, 0.3);
}

.rilegato-button:focus,
.woocommerce-Button.button:focus,
.woocommerce-form-row .woocommerce-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 113, 80, 0.2);
}

.button-text {
    margin-right: 8px;
}

/* ================ SWITCH LINKS ================ */
.rilegato-account-link,
.form-switch {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--rilegato-text-light);
}

.rilegato-account-link a,
.form-switch a {
    color: var(--rilegato-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--rilegato-transition);
}

.rilegato-account-link a:hover,
.form-switch a:hover {
    color: #ff5b36;
    text-decoration: underline;
}

/* ================ PASSWORD STRENGTH METER ================ */
.password-strength-meter {
    margin-top: 10px;
}

.password-strength-meter .strength-bar {
    height: 4px;
    background: var(--rilegato-border);
    border-radius: 2px;
    margin-bottom: 8px;
}

.password-hint {
    font-size: 12px;
    color: var(--rilegato-text-light);
}

/* ================ FORM VALIDAZIONE ================ */
.rilegato-form-row.has-error .input-text,
.input-wrapper.has-error input,
.woocommerce-form-row.has-error .input-text {
    border-color: var(--rilegato-error);
    background-color: rgba(229, 57, 53, 0.03);
}

.rilegato-form-row.has-error .error-message,
.input-wrapper.has-error .error-message,
.error-message {
    color: var(--rilegato-error);
    font-size: 12px;
    margin-top: 5px;
    animation: fadeIn 0.3s ease-in-out;
}

/* ================ MESSAGGI DI ERRORE E NOTIFICHE ================ */
.woocommerce-error,
.woocommerce-message,
.woocommerce-info {
    margin: 0 0 30px !important;
    padding: 15px 20px 15px 50px !important;
    border-radius: var(--rilegato-radius) !important;
    border: none !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    position: relative !important;
    color: var(--rilegato-text) !important;
}

.woocommerce-error {
    background-color: rgba(229, 57, 53, 0.1) !important;
    border-left: 4px solid var(--rilegato-error) !important;
}

.woocommerce-message {
    background-color: rgba(67, 160, 71, 0.1) !important;
    border-left: 4px solid var(--rilegato-success) !important;
}

.woocommerce-info {
    background-color: rgba(3, 169, 244, 0.1) !important;
    border-left: 4px solid #03A9F4 !important;
}

.woocommerce-error::before,
.woocommerce-message::before,
.woocommerce-info::before {
    position: absolute !important;
    left: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 16px !important;
}

/* Animazione shake per errori */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.6s cubic-bezier(.36,.07,.19,.97) both;
}

/* ================ COMPATIBILITÀ CON WOOCOMMERCE ================ */
/* Wrapper globale */
.woocommerce .customer-login {
    max-width: 100%;
    padding: 0;
}

/* Contenuto panel */
.woocommerce .customer-login .tabs-content {
    max-width: 600px;
    margin: 0 auto;
}

.woocommerce .customer-login .tabs-panel {
    padding: 40px;
    background: var(--rilegato-light);
}

/* Aggiustamenti per il form */
.woocommerce .customer-login .form-row-wrapper {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.woocommerce .customer-login .form-row-wrapper .form-row {
    flex: 0 0 100%;
    padding: 0 10px;
}

/* ================ RESPONSIVE DESIGN ================ */
@media (max-width: 991px) {
    .rilegato-account-panels,
    .woocommerce .customer-login .tabs-content,
    .woocommerce .customer-login .tabs-panel {
        max-width: 100%;
        padding: 30px 20px;
    }
    
    .customer-login .row {
        margin: 0;
    }
}

@media (max-width: 767px) {
    .rilegato-account-tabs,
    .woocommerce .customer-login .tabs-nav {
        flex-direction: column;
        align-items: center;
    }
    
    .rilegato-account-tabs .tab-link,
    .woocommerce .customer-login .tabs-nav li {
        width: 100%;
        margin-bottom: 0;
    }
    
    .rilegato-account-tabs .tab-link.active::after,
    .woocommerce .customer-login .tabs-nav a.active:after {
        width: 50%;
        left: 25%;
    }
    
    .form-actions,
    .woocommerce .customer-login .woocommerce-form-row__remember {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .lost-password,
    .woocommerce .customer-login .woocommerce-form-row__remember .lost-password {
        margin-top: 15px;
    }
}

.woocommerce-form-register .mc4wp-checkbox {
  margin-top: 20px;
}

.woocommerce-form-register .mc4wp-checkbox a {
  color: var(--rilegato-primary);
}

.form-notice {
  border-radius: 6px;
  padding: 10px 15px;
  margin: 20px 0;
  background-color: var(--rilegato-gray);
}
