/* ═══════════════════════════════════════════════════════════════════════════
   The Web Builders EU — Frontend Styles
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --twb-primary: #0057ff;
    --twb-primary-dark: #0041cc;
    --twb-accent: #00d4aa;
    --twb-accent-dark: #00b892;
    --twb-dark: #1a1a2e;
    --twb-text: #2d3436;
    --twb-text-light: #6c757d;
    --twb-bg: #f8f9fc;
    --twb-white: #ffffff;
    --twb-border: #e2e8f0;
    --twb-success: #00c853;
    --twb-warning: #ffab00;
    --twb-danger: #ff1744;
    --twb-radius: 12px;
    --twb-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    --twb-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --twb-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.twb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--twb-transition);
    line-height: 1.4;
    font-family: inherit;
}

.twb-btn-primary {
    background: var(--twb-primary);
    color: var(--twb-white);
    border-color: var(--twb-primary);
}

.twb-btn-primary:hover {
    background: var(--twb-primary-dark);
    border-color: var(--twb-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 87, 255, 0.3);
}

.twb-btn-accent {
    background: var(--twb-accent);
    color: var(--twb-dark);
    border-color: var(--twb-accent);
}

.twb-btn-accent:hover {
    background: var(--twb-accent-dark);
    border-color: var(--twb-accent-dark);
}

.twb-btn-outline {
    background: transparent;
    color: var(--twb-primary);
    border-color: var(--twb-primary);
}

.twb-btn-outline:hover {
    background: var(--twb-primary);
    color: var(--twb-white);
}

.twb-btn-small {
    padding: 8px 18px;
    font-size: 13px;
    border-radius: 8px;
}

.twb-btn-full {
    width: 100%;
}

.twb-btn:disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* ─── Pricing Grid ────────────────────────────────────────────────────────── */
.twb-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    padding: 20px 0;
}

.twb-pricing-card {
    background: var(--twb-white);
    border: 2px solid var(--twb-border);
    border-radius: var(--twb-radius);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: var(--twb-transition);
}

.twb-pricing-card:hover {
    border-color: var(--twb-primary);
    box-shadow: var(--twb-shadow-lg);
    transform: translateY(-4px);
}

.twb-pricing-popular {
    border-color: var(--twb-primary);
    box-shadow: 0 4px 24px rgba(0, 87, 255, 0.15);
}

.twb-pricing-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--twb-primary);
    color: var(--twb-white);
    padding: 5px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.twb-pricing-header {
    margin-bottom: 20px;
}

.twb-pricing-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--twb-dark);
    margin: 0 0 8px;
}

.twb-pricing-desc {
    color: var(--twb-text-light);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.twb-pricing-price {
    display: flex;
    align-items: baseline;
    gap: 2px;
    margin-bottom: 8px;
}

.twb-pricing-currency {
    font-size: 24px;
    font-weight: 700;
    color: var(--twb-dark);
}

.twb-pricing-amount {
    font-size: 48px;
    font-weight: 800;
    color: var(--twb-dark);
    line-height: 1;
}

.twb-pricing-period {
    font-size: 16px;
    color: var(--twb-text-light);
    font-weight: 500;
}

.twb-pricing-monthly {
    font-size: 13px;
    color: var(--twb-text-light);
    margin-bottom: 16px;
    padding: 8px 12px;
    background: var(--twb-bg);
    border-radius: 8px;
}

.twb-pricing-features {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    flex: 1;
}

.twb-pricing-features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--twb-text);
    border-bottom: 1px solid var(--twb-bg);
}

.twb-pricing-features li:last-child {
    border-bottom: none;
}

.twb-pricing-features li svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--twb-accent);
}

.twb-pricing-action {
    margin-top: auto;
    padding-top: 20px;
}

/* ─── Client Portal ───────────────────────────────────────────────────────── */
.twb-portal {
    max-width: 1100px;
    margin: 0 auto;
}

.twb-portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--twb-border);
}

.twb-portal-header h2 {
    margin: 0;
    color: var(--twb-dark);
}

.twb-portal-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 32px;
    padding: 6px;
    background: var(--twb-bg);
    border-radius: 12px;
    overflow-x: auto;
}

.twb-portal-nav a {
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--twb-text-light);
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    transition: var(--twb-transition);
}

.twb-portal-nav a:hover {
    color: var(--twb-dark);
    background: var(--twb-white);
}

.twb-portal-nav a.active {
    background: var(--twb-white);
    color: var(--twb-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    font-weight: 600;
}

/* ─── Dashboard Cards ─────────────────────────────────────────────────────── */
.twb-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 32px;
}

.twb-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.twb-card {
    background: var(--twb-white);
    border-radius: var(--twb-radius);
    padding: 24px;
    box-shadow: var(--twb-shadow);
    border: 1px solid var(--twb-border);
}

.twb-card-number {
    font-size: 36px;
    font-weight: 800;
    color: var(--twb-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.twb-card-label {
    color: var(--twb-text-light);
    font-size: 14px;
    margin-bottom: 12px;
}

.twb-card-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--twb-primary);
    text-decoration: none;
}

.twb-card-link:hover {
    text-decoration: underline;
}

/* ─── Service Cards ───────────────────────────────────────────────────────── */
.twb-service-card {
    background: var(--twb-white);
    border-radius: var(--twb-radius);
    border: 1px solid var(--twb-border);
    overflow: hidden;
    margin-bottom: 16px;
}

.twb-service-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: var(--twb-bg);
    border-bottom: 1px solid var(--twb-border);
}

.twb-service-card-header h3 {
    margin: 0;
    font-size: 18px;
}

.twb-service-card-body {
    padding: 20px 24px;
}

.twb-service-card-body p {
    margin: 4px 0;
    font-size: 14px;
}

.twb-service-card-actions {
    padding: 16px 24px;
    border-top: 1px solid var(--twb-border);
    display: flex;
    gap: 12px;
}

/* ─── Tables ──────────────────────────────────────────────────────────────── */
.twb-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--twb-white);
    border-radius: var(--twb-radius);
    overflow: hidden;
    box-shadow: var(--twb-shadow);
}

.twb-table thead {
    background: var(--twb-bg);
}

.twb-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--twb-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--twb-border);
}

.twb-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--twb-border);
}

.twb-table tr:last-child td {
    border-bottom: none;
}

.twb-table tr:hover td {
    background: rgba(0, 87, 255, 0.02);
}

/* ─── Status Badges ───────────────────────────────────────────────────────── */
.twb-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.twb-status-active,
.twb-status-paid,
.twb-status-completed { background: #e6f9f0; color: #00874a; }
.twb-status-pending    { background: #fff3e0; color: #e65100; }
.twb-status-cancelled  { background: #fce4ec; color: #c62828; }
.twb-status-past_due   { background: #fce4ec; color: #c62828; }
.twb-status-open       { background: #e3f2fd; color: #1565c0; }
.twb-status-closed     { background: #f5f5f5; color: #616161; }
.twb-status-in-progress { background: #e8eaf6; color: #283593; }

.twb-priority-low    { color: var(--twb-text-light); }
.twb-priority-normal { color: var(--twb-primary); }
.twb-priority-high   { color: var(--twb-warning); font-weight: 700; }
.twb-priority-urgent { color: var(--twb-danger); font-weight: 700; }

/* ─── Forms ───────────────────────────────────────────────────────────────── */
.twb-form-card {
    background: var(--twb-white);
    border-radius: var(--twb-radius);
    padding: 28px;
    box-shadow: var(--twb-shadow);
    border: 1px solid var(--twb-border);
    margin-bottom: 24px;
}

.twb-form-group {
    margin-bottom: 20px;
}

.twb-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--twb-dark);
    margin-bottom: 6px;
}

.twb-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--twb-border);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    color: var(--twb-text);
    background: var(--twb-white);
    transition: var(--twb-transition);
    box-sizing: border-box;
}

.twb-input:focus {
    outline: none;
    border-color: var(--twb-primary);
    box-shadow: 0 0 0 3px rgba(0, 87, 255, 0.12);
}

.twb-input::placeholder {
    color: #adb5bd;
}

.twb-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.twb-form-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ─── Auth Forms ──────────────────────────────────────────────────────────── */
.twb-auth-form {
    max-width: 480px;
    margin: 40px auto;
    background: var(--twb-white);
    padding: 40px;
    border-radius: var(--twb-radius);
    box-shadow: var(--twb-shadow);
    border: 1px solid var(--twb-border);
}

.twb-auth-form h2 {
    text-align: center;
    margin-bottom: 28px;
    color: var(--twb-dark);
}

.twb-auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--twb-text-light);
}

.twb-auth-link a {
    color: var(--twb-primary);
    font-weight: 600;
}

/* ─── Support Tickets ─────────────────────────────────────────────────────── */
.twb-support-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.twb-back-link {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--twb-primary);
    font-weight: 600;
    text-decoration: none;
}

.twb-ticket-detail {
    background: var(--twb-white);
    border-radius: var(--twb-radius);
    border: 1px solid var(--twb-border);
    overflow: hidden;
}

.twb-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: var(--twb-bg);
    border-bottom: 1px solid var(--twb-border);
}

.twb-ticket-header h3 { margin: 0; }

.twb-ticket-message {
    padding: 20px 24px;
    border-bottom: 1px solid var(--twb-border);
}

.twb-message-admin {
    background: #f0f4ff;
}

.twb-message-meta {
    font-size: 12px;
    color: var(--twb-text-light);
    margin-bottom: 8px;
    font-weight: 600;
}

.twb-message-body {
    font-size: 14px;
    line-height: 1.6;
}

.twb-ticket-reply-form {
    padding: 20px 24px;
}

/* ─── Order Confirmation ──────────────────────────────────────────────────── */
.twb-confirmation {
    max-width: 600px;
    margin: 40px auto;
    text-align: center;
}

.twb-confirmation-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.twb-confirmation ol {
    text-align: left;
    max-width: 500px;
    margin: 20px auto;
    padding-left: 24px;
}

.twb-confirmation ol li {
    margin-bottom: 12px;
    line-height: 1.5;
}

.twb-confirmation-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 32px;
}

/* ─── Portfolio ───────────────────────────────────────────────────────────── */
.twb-portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.twb-portfolio-item {
    background: var(--twb-white);
    border-radius: var(--twb-radius);
    overflow: hidden;
    box-shadow: var(--twb-shadow);
    border: 1px solid var(--twb-border);
    transition: var(--twb-transition);
}

.twb-portfolio-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--twb-shadow-lg);
}

.twb-portfolio-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.twb-portfolio-info {
    padding: 20px;
}

.twb-portfolio-info h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.twb-portfolio-client {
    font-size: 13px;
    color: var(--twb-text-light);
}

.twb-portfolio-tech {
    font-size: 12px;
    color: var(--twb-primary);
    font-weight: 600;
}

/* ─── Empty State ─────────────────────────────────────────────────────────── */
.twb-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--twb-bg);
    border-radius: var(--twb-radius);
    border: 2px dashed var(--twb-border);
}

.twb-empty-state h3 {
    color: var(--twb-dark);
    margin-bottom: 8px;
}

.twb-empty-state p {
    color: var(--twb-text-light);
    margin-bottom: 20px;
}

/* ─── Alerts / Messages ───────────────────────────────────────────────────── */
.twb-alert {
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}

.twb-alert-success {
    background: #e6f9f0;
    color: #00874a;
    border: 1px solid #b2dfdb;
}

.twb-alert-error {
    background: #fce4ec;
    color: #c62828;
    border: 1px solid #f8bbd0;
}

.twb-alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

/* ─── Testimonials ────────────────────────────────────────────────────────── */
.twb-testimonials {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.twb-testimonial-card {
    background: var(--twb-white);
    padding: 24px;
    border-radius: var(--twb-radius);
    border: 1px solid var(--twb-border);
}

.twb-testimonial-text {
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 16px;
    color: var(--twb-text);
}

.twb-testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.twb-testimonial-author img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* ─── Billing Portal ──────────────────────────────────────────────────────── */
.twb-billing-portal {
    margin-top: 32px;
    background: var(--twb-bg);
    padding: 24px;
    border-radius: var(--twb-radius);
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .twb-pricing-grid {
        grid-template-columns: 1fr;
    }

    .twb-portal-nav {
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .twb-portal-nav a {
        padding: 8px 14px;
        font-size: 13px;
    }

    .twb-form-2col {
        grid-template-columns: 1fr;
    }

    .twb-auth-form {
        margin: 20px 16px;
        padding: 24px;
    }

    .twb-portal-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .twb-service-card-header {
        flex-direction: column;
        gap: 8px;
    }

    .twb-confirmation-actions {
        flex-direction: column;
    }

    .twb-portfolio-grid {
        grid-template-columns: 1fr;
    }

    .twb-grid-3 {
        grid-template-columns: 1fr;
    }

    .twb-table {
        font-size: 13px;
    }

    .twb-table th,
    .twb-table td {
        padding: 10px 12px;
    }
}
