/**
 * Account pages — login/register, dashboard, orders, edit.
 *
 * @package ZIT_Sales
 */

/* ── Login page layout ─────────────────────────────── */
.account-page {
    padding: 48px 0 64px;
    background: #f8f9fa;
    min-height: 60vh;
}

.account-login-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.account-login-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.09);
    overflow: hidden;
}

.account-login-card__header {
    padding: 28px 32px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.account-login-card__header h1 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 6px;
}

.account-login-card__header p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.woocommerce-form-login {
    padding: 24px 32px 32px;
}

/* ── Form groups ───────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-group label .required {
    color: #ef4444;
    margin-left: 2px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group select,
.woocommerce-Input--text {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid #d1d5db;
    border-radius: 7px;
    font-size: 14px;
    color: #1a1a1a;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.woocommerce-Input--text:focus {
    border-color: var(--zit-primary);
    box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.1);
    outline: none;
}

/* ── Password field with show/hide toggle ──────────── */
.password-input {
    position: relative;
    display: block;
}

.password-input input[type="password"],
.password-input input[type="text"] {
    padding-right: 44px; /* room for the eye button */
    width: 100%;
    box-sizing: border-box;
}

.show-password-input {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.show-password-input:hover {
    color: var(--zit-primary);
}

/* WooCommerce uses ::before pseudo with a dashicon */
.show-password-input::before {
    font-family: dashicons;
    font-size: 18px;
    content: "\f177"; /* dashicons-visibility (eye open) */
    line-height: 1;
}

.show-password-input[aria-label="Hide password"]::before {
    content: "\f530"; /* dashicons-hidden (eye closed) */
}

/* ── Remember me / Forgot password row ────────────── */
.form-group--inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.form-group--inline label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin: 0;
    cursor: pointer;
}

.form-group--inline input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--zit-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.woocommerce-LostPassword {
    font-size: 13px;
    color: var(--zit-primary);
    text-decoration: none;
}

.woocommerce-LostPassword:hover {
    text-decoration: underline;
}

/* ── WC notices on account page ────────────────────── */
.account-page .woocommerce-error,
.account-page .woocommerce-message,
.account-page .woocommerce-info {
    margin-bottom: 20px;
    border-radius: 7px;
}

/* ── Auth tabs & forms (legacy page template) ──────── */
.account-auth {
    max-width: 460px;
    margin: 40px auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.auth-tabs {
    display: flex;
    border-bottom: 2px solid #f0f0f0;
}

.auth-tab {
    flex: 1;
    padding: 14px;
    border: none;
    background: #fafafa;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.auth-tab:hover {
    background: #f5f5f5;
    color: #333;
}

.auth-tab.active {
    background: #fff;
    color: var(--zit-primary);
    border-bottom: 2px solid var(--zit-primary);
    margin-bottom: -2px;
}

.auth-panel {
    display: none;
    padding: 28px 24px;
}

.auth-panel.active {
    display: block;
}

.auth-panel .form-row {
    margin-bottom: 16px;
}

.auth-panel label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.auth-panel input[type="text"],
.auth-panel input[type="email"],
.auth-panel input[type="tel"],
.auth-panel input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.auth-panel input:focus {
    border-color: var(--zit-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.1);
}

.auth-panel input[type="checkbox"] {
    width: auto;
    margin-right: 6px;
}

.auth-errors {
    padding: 10px 14px;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 14px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ── Account navigation (legacy .account-nav) ──────── */
.account-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.account-nav .btn {
    font-size: 13px;
    padding: 6px 14px;
}

/* ── WooCommerce My Account navigation ─────────────── */
.woocommerce-MyAccount-navigation {
    margin-bottom: 28px;
}

.woocommerce-MyAccount-navigation ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 2px solid #eee;
    padding-bottom: 12px;
}

.woocommerce-MyAccount-navigation ul li {
    margin: 0;
}

.woocommerce-MyAccount-navigation ul li a {
    display: inline-block;
    padding: 7px 16px;
    border-radius: 6px;
    background: #f4f5f7;
    color: #555;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    border: 1px solid transparent;
}

.woocommerce-MyAccount-navigation ul li a:hover {
    background: #e8edf5;
    color: #1a1a1a;
}

.woocommerce-MyAccount-navigation ul li.is-active a,
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--active a {
    background: var(--zit-primary);
    color: #fff;
    border-color: var(--zit-primary);
}

@media (max-width: 480px) {
    .woocommerce-MyAccount-navigation ul {
        flex-direction: column;
        gap: 4px;
    }

    .woocommerce-MyAccount-navigation ul li a {
        display: block;
        text-align: center;
    }
}

/* ── Dashboard ─────────────────────────────────────── */
.account-dashboard h1,
.account-orders h1,
.account-order-detail h1,
.account-edit h1 {
    font-size: 24px;
    margin-bottom: 16px;
    color: #1a1a1a;
}

.account-dashboard h2 {
    font-size: 18px;
    margin-bottom: 12px;
    color: #333;
}

/* ── Tables ────────────────────────────────────────── */
.account-dashboard table,
.account-orders table,
.account-order-detail table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.account-dashboard th,
.account-orders th,
.account-order-detail th {
    text-align: left;
    padding: 10px 12px;
    background: #f8f9fa;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #eee;
}

.account-dashboard td,
.account-orders td,
.account-order-detail td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #333;
}

.account-dashboard tbody tr:hover,
.account-orders tbody tr:hover {
    background: #fafbfc;
}

.account-orders a,
.account-order-detail a {
    color: var(--zit-primary);
    text-decoration: none;
}

.account-orders a:hover,
.account-order-detail a:hover {
    text-decoration: underline;
}

/* ── Order detail ──────────────────────────────────── */
.order-info {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.order-info h3 {
    font-size: 16px;
    margin: 20px 0 10px;
    color: #333;
}

.order-info p {
    line-height: 1.7;
    color: #555;
    font-size: 14px;
}

/* ── Edit account ──────────────────────────────────── */
.account-edit form {
    max-width: 500px;
}

.account-edit .form-row {
    margin-bottom: 16px;
}

.account-edit label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.account-edit input[type="text"],
.account-edit input[type="email"],
.account-edit input[type="tel"],
.account-edit input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.account-edit input:focus {
    border-color: var(--zit-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.1);
}

.notice-success {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* ── Pagination ────────────────────────────────────── */
.account-orders .pagination {
    margin-top: 20px;
    text-align: center;
}

.account-orders .pagination a,
.account-orders .pagination span {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    color: #555;
    text-decoration: none;
}

.account-orders .pagination .current {
    background: var(--zit-primary);
    color: #fff;
    border-color: var(--zit-primary);
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
    .account-page {
        padding: 24px 0 40px;
    }

    .account-login-card__header,
    .woocommerce-form-login {
        padding-left: 20px;
        padding-right: 20px;
    }

    .account-auth {
        margin: 20px 16px;
    }

    .auth-panel {
        padding: 20px 16px;
    }

    .account-dashboard table,
    .account-orders table {
        font-size: 13px;
    }

    .account-dashboard th,
    .account-dashboard td,
    .account-orders th,
    .account-orders td {
        padding: 8px;
    }

    .order-info {
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .account-nav {
        flex-direction: column;
    }

    .account-nav .btn {
        text-align: center;
    }

    .account-dashboard table thead,
    .account-orders table thead {
        display: none;
    }

    .account-dashboard table tr,
    .account-orders table tr {
        display: block;
        margin-bottom: 12px;
        border: 1px solid #eee;
        border-radius: 6px;
        padding: 10px;
    }

    .account-dashboard table td,
    .account-orders table td {
        display: block;
        border: none;
        padding: 4px 0;
        font-size: 13px;
    }

    .account-dashboard table td::before,
    .account-orders table td::before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 8px;
        color: #666;
    }
}
