/* ==========================================================================
    CUSTOMER ACCOUNT PORTAL - CORE UI
   ========================================================================== */

.pt-wrap {
    max-width: 1100px;
    margin: 20px auto;
    background: #ffffff;
    padding: 40px;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #333;
    line-height: 1.5;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.pt-invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #ccc;
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.pt-grid-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

.pt-panel {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pt-panel-title {
    font-size: 16px;
    font-weight: bold;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: #222;
}

/* Form Grid & Inputs */
.pt-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.pt-form-group label {
    display: block;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 5px;
}

.pt-form-group input[type="text"],
.pt-form-group input[type="email"],
.pt-form-group input[type="number"],
.pt-form-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    box-sizing: border-box;
    color: #222;
}

/* Financials & Transaction History */
.pt-invoice-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.pt-invoice-table th {
    text-align: left;
    border-bottom: 1px solid #ccc;
    padding: 8px 5px;
    color: #555;
}

.pt-invoice-table td {
    padding: 8px 5px;
    border-bottom: 1px solid #eee;
}

.pt-balance-highlight {
    background: #f9f9f9;
    border: 1px solid #eee;
    padding: 15px;
    text-align: center;
    margin-bottom: 20px;
}

/* Buttons & Navigation */
.pt-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 3px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    display: inline-block;
    text-align: center;
}

/* Interaction Fix: Ensures button visibility across all states */
.pt-btn-success,
.pt-btn-success:hover,
.pt-btn-success:focus,
.pt-btn-success:active {
    background-color: #28a745 !important;
    color: #ffffff !important;
    border: 1px solid #218838 !important;
    width: 100%;
    margin-top: 15px;
    visibility: visible !important;
    opacity: 1 !important;
    text-decoration: none !important;
}

.pt-btn:disabled {
    cursor: not-allowed;
    background-color: #444 !important;
    opacity: 0.7;
}

/* Utilities & Messaging */
.pt-info-box {
    background: #e7f3fe;
    border-left: 4px solid #2196F3;
    padding: 10px 15px;
    font-size: 12px;
    margin-bottom: 20px;
    color: #333;
}

.pt-badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    font-weight: bold;
}

.badge-red {
    background: #fee;
    color: #c00;
    border: 1px solid #fcc;
}

.badge-green {
    background: #efe;
    color: #080;
    border: 1px solid #cfc;
}

.pt-hidden {
    display: none !important;
}

/* Account Options */
.pt-payment-label {
    display: flex;
    align-items: center;
    font-size: 14px;
    margin-bottom: 12px;
    cursor: pointer;
    color: #222;
}

.pt-payment-label input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

.pt-ledger-option {
    display: block;
    font-size: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    padding: 8px;
    border: 1px solid transparent;
    border-radius: 3px;
}

.pt-ledger-option:hover {
    background: #f9f9f9;
    border-color: #eee;
}

/* Status Messaging */
#pt-portal-status,
#pt-payment-error {
    background: rgba(255, 77, 77, 0.1);
    border-radius: 4px;
    margin: 15px 0;
    font-size: 13px;
    font-weight: bold;
    text-align: center;
}

#pt-portal-status:empty,
#pt-payment-error:empty {
    display: none;
}

/* Visual Integrity: Differentiates hints from saved data values */
.pt-wrap input::placeholder,
.pt-wrap select::placeholder,
.pt-wrap textarea::placeholder {
    color: #bbb !important;
    opacity: 0.6 !important;
    font-style: italic;
    font-weight: 300;
}
/* ==========================================================================
    PORTAL REFACTOR: FINANCIALS FIRST STACK
   ========================================================================== */

/* Main Layout Constraints */
.pt-stack-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Typography & Titles */
.pt-invoice-header h1 {
    margin: 0 0 5px 0;
    font-size: 24px;
    font-weight: 600;
    color: #1d2327;
}

.pt-invoice-header p {
    margin: 0;
    font-size: 13px;
    color: #50575e;
}

.pt-header-ref-label {
    font-size: 11px;
    font-weight: 700;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pt-header-ref-val {
    font-size: 24px;
    font-weight: 700;
    color: #1d2327;
}

.pt-panel h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
    border-bottom: 1px solid #dcdcde;
    padding-bottom: 15px;
    margin: 0 0 20px 0;
}

.pt-manifest-hub h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 20px 0;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 10px;
}

/* Financial Specifics */
.pt-balance-highlight {
    margin-bottom: 25px;
    background: transparent;
    border: none;
    padding: 0;
    text-align: left;
}

.pt-balance-highlight-label {
    font-size: 13px;
    font-weight: 700;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pt-balance-val {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.1;
}

.pt-balance-red { color: #d63638; }
.pt-balance-green { color: #008a20; }

.pt-checkout-form {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    padding: 20px;
    border-radius: 4px;
}

/* Form Groups & Inputs overrides for unified styling */
.pt-input-block {
    margin-bottom: 15px;
}

.pt-input-block label {
    display: block;
    font-weight: 600;
    color: #2c3338;
    font-size: 13px;
    margin-bottom: 5px;
    text-transform: none;
}

/* Native Accordion Details/Summary */
.ptc-details-card {
    border: 1px solid #dcdcde;
    border-radius: 4px;
    margin-bottom: 15px;
}

.ptc-details-card.is-active {
    background: #fff;
    border-left: 4px solid #2271b1;
}

.ptc-details-card.is-inactive {
    background: #f6f7f7;
    border-left: 1px solid #dcdcde;
}

.ptc-details-card summary::-webkit-details-marker {
    display: none;
}

.ptc-details-card summary {
    list-style: none;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ptc-details-card summary::after {
    content: "▼";
    font-size: 12px;
    margin-left: 10px;
    color: #646970;
}

.ptc-details-card[open] summary::after {
    content: "▲";
}

.ptc-details-card[open] summary {
    border-bottom: 1px solid #dcdcde;
}

.pt-details-body {
    padding: 20px;
}

/* Action Elements */
.pt-btn-primary {
    background: #1d2327;
    color: #fff;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 3px;
    cursor: pointer;
}

.pt-btn-primary:hover {
    background: #2c3338;
}

.pt-send-invite-btn {
    background: #fff;
    color: #2271b1;
    border: 1px solid #2271b1;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 15px;
}

.pt-send-invite-btn:hover {
    background: #f0f6fc;
}

/* Customer Portal primary action button */
.pt-wrap button.pt-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 22px;
    border: 0;
    border-radius: 4px;
    background: #0073aa;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}

.pt-wrap button.pt-action-button:hover,
.pt-wrap button.pt-action-button:focus,
.pt-wrap button.pt-action-button:active {
    background: #005f8d;
    color: #ffffff;
    text-decoration: none;
}
