/**
 * CPT Portal Core — Frontend Stylesheet
 * Cutie Pie Transport LLC
 *
 * Brand Colors:
 *   Primary:    #1a1a2e  (Deep navy)
 *   Accent:     #e94560  (Hot red/coral)
 *   Secondary:  #f5a623  (Amber/gold)
 *   Light BG:   #f8f9fc
 *   Text:       #2d3748
 *   Border:     #e2e8f0
 *
 * @package CPT_Portal_Core
 */

/* =========================================================
   1. CSS Custom Properties
   ========================================================= */
:root {
    --cpt-primary:       #1a1a2e;
    --cpt-accent:        #e94560;
    --cpt-secondary:     #f5a623;
    --cpt-success:       #27ae60;
    --cpt-warning:       #f39c12;
    --cpt-danger:        #c0392b;
    --cpt-info:          #2980b9;
    --cpt-light-bg:      #f8f9fc;
    --cpt-white:         #ffffff;
    --cpt-text:          #2d3748;
    --cpt-text-muted:    #718096;
    --cpt-border:        #e2e8f0;
    --cpt-radius:        8px;
    --cpt-radius-lg:     12px;
    --cpt-shadow:        0 2px 8px rgba(0,0,0,.08);
    --cpt-shadow-lg:     0 8px 30px rgba(0,0,0,.12);
    --cpt-transition:    all .2s ease;
    --cpt-font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* =========================================================
   2. Base Reset / Container
   ========================================================= */
.cpt-portal-wrap,
.cpt-intake-wrap,
.cpt-pricing-wrap,
.cpt-contract-wrap,
.cpt-locked-wrap {
    font-family: var(--cpt-font);
    color: var(--cpt-text);
    line-height: 1.6;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================================
   3. Intake Form
   ========================================================= */
.cpt-intake-wrap {
    background: var(--cpt-white);
    border-radius: var(--cpt-radius-lg);
    box-shadow: var(--cpt-shadow-lg);
    padding: 40px;
    margin: 40px auto;
}

.cpt-intake-wrap h2 {
    font-size: 1.8rem;
    color: var(--cpt-primary);
    margin-bottom: 8px;
}

.cpt-intake-wrap .cpt-form-subtitle {
    color: var(--cpt-text-muted);
    margin-bottom: 32px;
    font-size: .95rem;
}

.cpt-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.cpt-form-row.full-width {
    grid-template-columns: 1fr;
}

@media ( max-width: 640px ) {
    .cpt-form-row { grid-template-columns: 1fr; }
    .cpt-intake-wrap { padding: 24px 16px; }
}

.cpt-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cpt-field-group label {
    font-weight: 600;
    font-size: .875rem;
    color: var(--cpt-primary);
}

.cpt-field-group .cpt-required {
    color: var(--cpt-accent);
    margin-left: 2px;
}

.cpt-field-group input[type="text"],
.cpt-field-group input[type="email"],
.cpt-field-group input[type="tel"],
.cpt-field-group input[type="number"],
.cpt-field-group select,
.cpt-field-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--cpt-border);
    border-radius: var(--cpt-radius);
    font-size: .9rem;
    font-family: var(--cpt-font);
    color: var(--cpt-text);
    background: var(--cpt-white);
    transition: var(--cpt-transition);
    box-sizing: border-box;
}

.cpt-field-group input:focus,
.cpt-field-group select:focus,
.cpt-field-group textarea:focus {
    outline: none;
    border-color: var(--cpt-accent);
    box-shadow: 0 0 0 3px rgba(233,69,96,.12);
}

.cpt-field-group .cpt-field-hint {
    font-size: .8rem;
    color: var(--cpt-text-muted);
}

.cpt-field-group .cpt-field-error {
    font-size: .8rem;
    color: var(--cpt-danger);
    display: none;
}

.cpt-field-group.has-error input,
.cpt-field-group.has-error select {
    border-color: var(--cpt-danger);
}

.cpt-field-group.has-error .cpt-field-error {
    display: block;
}

/* Submit button */
.cpt-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--cpt-radius);
    font-weight: 700;
    font-size: .95rem;
    font-family: var(--cpt-font);
    cursor: pointer;
    border: none;
    transition: var(--cpt-transition);
    text-decoration: none;
}

.cpt-btn-primary {
    background: var(--cpt-accent);
    color: var(--cpt-white);
}

.cpt-btn-primary:hover {
    background: #c73652;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(233,69,96,.35);
}

.cpt-btn-secondary {
    background: var(--cpt-primary);
    color: var(--cpt-white);
}

.cpt-btn-secondary:hover {
    background: #2d2d4e;
}

.cpt-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

.cpt-btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cpt-spin .7s linear infinite;
}

.cpt-btn.is-loading .cpt-btn-spinner { display: inline-block; }
.cpt-btn.is-loading .cpt-btn-text    { opacity: .7; }

@keyframes cpt-spin { to { transform: rotate(360deg); } }

/* Form notices */
.cpt-form-notice {
    padding: 14px 18px;
    border-radius: var(--cpt-radius);
    font-size: .9rem;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.cpt-form-notice-success {
    background: #ecfdf5;
    border-left: 4px solid var(--cpt-success);
    color: #065f46;
}

.cpt-form-notice-error {
    background: #fef2f2;
    border-left: 4px solid var(--cpt-danger);
    color: #991b1b;
}

.cpt-form-notice-info {
    background: #eff6ff;
    border-left: 4px solid var(--cpt-info);
    color: #1e3a5f;
}

/* =========================================================
   4. Pricing Section
   ========================================================= */
.cpt-pricing-wrap {
    padding: 60px 20px;
}

.cpt-pricing-wrap h2 {
    text-align: center;
    font-size: 2rem;
    color: var(--cpt-primary);
    margin-bottom: 8px;
}

.cpt-pricing-wrap .cpt-pricing-subtitle {
    text-align: center;
    color: var(--cpt-text-muted);
    margin-bottom: 48px;
}

.cpt-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.cpt-pricing-card {
    background: var(--cpt-white);
    border-radius: var(--cpt-radius-lg);
    border: 1.5px solid var(--cpt-border);
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--cpt-shadow);
    position: relative;
    transition: var(--cpt-transition);
}

.cpt-pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--cpt-shadow-lg);
}

.cpt-pricing-card.featured {
    border-color: var(--cpt-accent);
    background: linear-gradient(135deg, #fff5f7, #fff);
}

.cpt-pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--cpt-accent);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 99px;
    white-space: nowrap;
    letter-spacing: .04em;
}

.cpt-pricing-card h3 {
    font-size: 1.15rem;
    color: var(--cpt-primary);
    margin: 0 0 4px;
}

.cpt-pricing-fleet {
    font-size: .8rem;
    color: var(--cpt-text-muted);
    margin-bottom: 20px;
}

.cpt-pricing-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--cpt-accent);
    margin-bottom: 4px;
}

.cpt-pricing-period {
    font-size: .8rem;
    color: var(--cpt-text-muted);
    margin-bottom: 24px;
}

.cpt-pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
    text-align: left;
}

.cpt-pricing-features li {
    padding: 6px 0;
    font-size: .875rem;
    color: var(--cpt-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cpt-pricing-features li::before {
    content: '✓';
    color: var(--cpt-success);
    font-weight: 700;
    flex-shrink: 0;
}

/* =========================================================
   5. Portal Dashboard
   ========================================================= */
.cpt-portal-wrap {
    padding: 32px 0;
}

.cpt-portal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 12px;
}

.cpt-portal-header h1 {
    font-size: 1.6rem;
    color: var(--cpt-primary);
    margin: 0;
}

.cpt-portal-status-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.cpt-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 99px;
    font-size: .8rem;
    font-weight: 600;
}

.cpt-status-chip.active   { background: #ecfdf5; color: #065f46; }
.cpt-status-chip.pending  { background: #fffbeb; color: #92400e; }
.cpt-status-chip.inactive { background: #f3f4f6; color: #6b7280; }
.cpt-status-chip.alert    { background: #fef2f2; color: #991b1b; }

.cpt-portal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media ( max-width: 720px ) {
    .cpt-portal-grid { grid-template-columns: 1fr; }
}

.cpt-portal-card {
    background: var(--cpt-white);
    border-radius: var(--cpt-radius-lg);
    border: 1.5px solid var(--cpt-border);
    padding: 24px;
    box-shadow: var(--cpt-shadow);
}

.cpt-portal-card h3 {
    font-size: 1rem;
    color: var(--cpt-primary);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--cpt-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Status Steps */
.cpt-status-steps {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cpt-status-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--cpt-border);
    font-size: .875rem;
}

.cpt-status-step:last-child { border-bottom: none; }

.cpt-step-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: .8rem;
    font-weight: 700;
}

.cpt-step-done     { background: #ecfdf5; color: #065f46; }
.cpt-step-pending  { background: #fffbeb; color: #92400e; }
.cpt-step-inactive { background: var(--cpt-border); color: var(--cpt-text-muted); }

/* =========================================================
   6. Contract Signing Page
   ========================================================= */
.cpt-contract-wrap {
    background: var(--cpt-white);
    border-radius: var(--cpt-radius-lg);
    box-shadow: var(--cpt-shadow-lg);
    padding: 48px;
    margin: 40px auto;
    max-width: 800px;
}

.cpt-contract-body {
    background: var(--cpt-light-bg);
    border: 1px solid var(--cpt-border);
    border-radius: var(--cpt-radius);
    padding: 28px;
    font-size: .875rem;
    line-height: 1.8;
    max-height: 420px;
    overflow-y: auto;
    margin-bottom: 28px;
    color: var(--cpt-text);
}

.cpt-contract-body h3 { color: var(--cpt-primary); margin-top: 24px; }

.cpt-signature-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media ( max-width: 600px ) { .cpt-signature-row { grid-template-columns: 1fr; } }

.cpt-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: .875rem;
    margin-bottom: 20px;
    color: var(--cpt-text);
}

.cpt-checkbox-row input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: var(--cpt-accent);
}

/* =========================================================
   7. Portal Locked Screen
   ========================================================= */
.cpt-locked-wrap {
    text-align: center;
    padding: 80px 20px;
    max-width: 560px;
}

.cpt-locked-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.cpt-locked-wrap h2 {
    font-size: 1.6rem;
    color: var(--cpt-primary);
    margin-bottom: 12px;
}

.cpt-locked-wrap p {
    color: var(--cpt-text-muted);
    font-size: .95rem;
    margin-bottom: 28px;
}

.cpt-locked-steps {
    background: var(--cpt-light-bg);
    border-radius: var(--cpt-radius-lg);
    padding: 24px;
    text-align: left;
    margin-bottom: 32px;
}

/* =========================================================
   8. Badges & Status Indicators
   ========================================================= */
.cpt-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}

.cpt-badge-success  { background: #ecfdf5; color: #065f46; }
.cpt-badge-warning  { background: #fffbeb; color: #92400e; }
.cpt-badge-danger   { background: #fef2f2; color: #991b1b; }
.cpt-badge-info     { background: #eff6ff; color: #1e3a5f; }
.cpt-badge-neutral  { background: #f3f4f6; color: #374151; }

/* =========================================================
   9. Responsive Utilities
   ========================================================= */
@media ( max-width: 480px ) {
    .cpt-contract-wrap { padding: 24px 16px; }
    .cpt-pricing-price { font-size: 1.6rem; }
}
