/* Baratie Membership - palette: #952926 (rosso mattone) #351212 (bordeaux scuro) #f0e8e6 (avorio) */

.baratie-box {
    max-width: 440px;
    margin: 2rem auto;
    padding: 2rem;
    background: #f0e8e6;
    border: 1px solid #d8c9c5;
    border-radius: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #351212;
}

.baratie-box.baratie-info {
    text-align: center;
}

.baratie-form .baratie-row {
    display: flex;
    gap: 1rem;
}

.baratie-form .baratie-row .baratie-field {
    flex: 1;
}

.baratie-field {
    margin-bottom: 1.1rem;
}

.baratie-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: #351212;
}

.baratie-field input[type="text"],
.baratie-field input[type="email"],
.baratie-field input[type="tel"],
.baratie-field input[type="password"],
.baratie-field input[type="date"] {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #c9b6b1;
    border-radius: 8px;
    background: #ffffff;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.baratie-field input:focus {
    outline: none;
    border-color: #952926;
    box-shadow: 0 0 0 3px rgba(149, 41, 38, 0.15);
}

.baratie-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: 400;
    font-size: 0.85rem;
}

.baratie-checkbox input {
    margin-top: 0.2rem;
}

.baratie-checkbox a {
    color: #952926;
}

.baratie-btn {
    display: inline-block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #952926;
    color: #f0e8e6;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    transition: background 0.15s ease;
}

.baratie-btn:hover {
    background: #7a201d;
    color: #f0e8e6;
}

.baratie-btn-outline {
    background: transparent;
    color: #952926;
    border: 1px solid #952926;
    margin-top: 0.5rem;
}

.baratie-btn-outline:hover {
    background: rgba(149, 41, 38, 0.08);
}

.baratie-switch {
    text-align: center;
    font-size: 0.85rem;
    margin-top: 1rem;
}

.baratie-switch a {
    color: #952926;
    font-weight: 600;
}

.baratie-errors {
    background: #fbe7e6;
    border: 1px solid #952926;
    color: #7a201d;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.baratie-errors ul {
    margin: 0;
    padding-left: 1.1rem;
}

.baratie-success h3 {
    margin-top: 0;
    color: #952926;
}

/* --- Tessera fedeltà --- */

.baratie-tessera-wrap {
    max-width: 420px;
    margin: 3rem auto;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.baratie-tessera {
    position: relative;
    aspect-ratio: 1.6 / 1;
    border-radius: 18px;
    padding: 1.75rem;
    background: linear-gradient(135deg, #952926 0%, #351212 100%);
    color: #f0e8e6;
    box-shadow: 0 12px 30px rgba(53, 18, 18, 0.35);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    overflow: hidden;
}

.baratie-tessera::before {
    content: "";
    position: absolute;
    top: -40%;
    right: -20%;
    width: 65%;
    height: 180%;
    background: rgba(240, 232, 230, 0.06);
    transform: rotate(20deg);
}

.baratie-tessera-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    position: relative;
    z-index: 1;
}

.baratie-tessera-brand {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.baratie-tessera-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.75;
}

.baratie-tessera-name {
    position: relative;
    z-index: 1;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.baratie-tessera-bottom {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-size: 0.8rem;
    opacity: 0.9;
}

.baratie-tessera-number {
    font-family: "Courier New", monospace;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.baratie-tessera-footer {
    margin-top: 1.2rem;
    font-size: 0.85rem;
}

.baratie-tessera-footer a {
    color: #952926;
}

.baratie-barcode-box {
    background: #ffffff;
    border-radius: 10px;
    padding: 0.75rem 1rem 0.5rem;
    margin-top: 1rem;
    text-align: center;
    box-shadow: 0 4px 14px rgba(53, 18, 18, 0.15);
}

.baratie-barcode-box svg {
    max-width: 100%;
}

@media (max-width: 480px) {
    .baratie-form .baratie-row {
        flex-direction: column;
        gap: 0;
    }
}

/* --- Punti sulla tessera --- */

.baratie-tessera-points {
    position: relative;
    z-index: 1;
    font-size: 1.6rem;
    font-weight: 800;
}

.baratie-tessera-points span {
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.8;
    margin-left: 0.3rem;
}

/* --- Premi sotto la tessera --- */

.baratie-rewards {
    margin-top: 1.5rem;
    text-align: left;
    background: #f0e8e6;
    border: 1px solid #d8c9c5;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}

.baratie-rewards h4 {
    margin-top: 0;
    color: #351212;
}

.baratie-rewards-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.baratie-rewards-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #e3d4d0;
}

.baratie-rewards-list li:last-child {
    border-bottom: none;
}

.baratie-rewards-list p {
    margin: 0.15rem 0 0;
    font-size: 0.8rem;
    color: #6b5450;
}

.baratie-reward-cost {
    flex-shrink: 0;
    font-weight: 700;
    color: #952926;
    background: #ffffff;
    border: 1px solid #952926;
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.8rem;
}

.baratie-reward-locked {
    opacity: 0.5;
}

.baratie-rewards-hint {
    margin: 0.75rem 0 0;
    font-size: 0.75rem;
    color: #6b5450;
    text-align: center;
}

/* --- Gestionale --- */

.baratie-gest-wrap {
    max-width: 900px;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #351212;
}

.baratie-gest-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.baratie-gest-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #952926;
}

.baratie-gest-logout {
    background: none;
    border: 1px solid #952926;
    color: #952926;
    border-radius: 6px;
    padding: 0.4rem 0.9rem;
    cursor: pointer;
}

.baratie-gest-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e3d4d0;
}

.baratie-gest-tabs a {
    padding: 0.6rem 1rem;
    text-decoration: none;
    color: #6b5450;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.baratie-gest-tabs a.active {
    color: #952926;
    border-bottom-color: #952926;
}

.baratie-gest-search {
    margin-bottom: 1.5rem;
}

.baratie-gest-search form {
    display: flex;
    gap: 0.5rem;
}

.baratie-gest-search input {
    flex: 1;
    padding: 0.65rem 0.9rem;
    border: 1px solid #c9b6b1;
    border-radius: 8px;
}

.baratie-gest-search .baratie-btn {
    width: auto;
    padding: 0.65rem 1.4rem;
}

.baratie-gest-empty {
    color: #6b5450;
}

.baratie-gest-count {
    font-size: 0.85rem;
    color: #6b5450;
    margin-bottom: 0.75rem;
}

.baratie-gest-card {
    background: #f0e8e6;
    border: 1px solid #d8c9c5;
    border-radius: 12px;
    padding: 1.5rem;
}

.baratie-gest-client-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.baratie-gest-points-badge {
    background: #952926;
    color: #f0e8e6;
    font-weight: 800;
    padding: 0.5rem 1rem;
    border-radius: 999px;
}

.baratie-gest-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.baratie-gest-panel {
    background: #ffffff;
    border: 1px solid #d8c9c5;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.baratie-gest-panel h4 {
    margin-top: 0;
}

.baratie-gest-panel label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0.6rem 0 0.25rem;
}

.baratie-gest-panel input,
.baratie-gest-panel select,
.baratie-gest-panel textarea {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid #c9b6b1;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: inherit;
}

.baratie-gest-panel .baratie-btn {
    margin-top: 0.9rem;
    width: auto;
    padding: 0.55rem 1.2rem;
}

.baratie-gest-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}

.baratie-gest-table th,
.baratie-gest-table td {
    text-align: left;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid #e3d4d0;
    font-size: 0.85rem;
}

.baratie-gest-table th {
    background: #351212;
    color: #f0e8e6;
}

.baratie-positive {
    color: #1a7d3a;
    font-weight: 700;
}

.baratie-negative {
    color: #952926;
    font-weight: 700;
}

.baratie-gest-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.baratie-link-btn {
    background: none;
    border: none;
    color: #952926;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
}

.baratie-link-danger {
    color: #6b1210;
}

.baratie-gest-success {
    background: #e3f3e6;
    border: 1px solid #1a7d3a;
    color: #1a7d3a;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

@media (max-width: 700px) {
    .baratie-gest-grid {
        grid-template-columns: 1fr;
    }
}
