/* PaperTone Plan Room — Frontend Styles */
/* All classes prefixed with pt- to avoid theme conflicts */

.pt-portal {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 15px;
    color: #1d2327;
    line-height: 1.5;
}

/* Portal Header */
.pt-portal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.pt-portal-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 4px;
    color: #1d2327;
}

.pt-portal-subtitle {
    font-size: 14px;
    color: #646970;
    margin: 0;
}

/* Cards */
.pt-portal-card {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pt-portal-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px;
}

/* Form Fields */
.pt-form .pt-field {
    margin-bottom: 16px;
}

.pt-form label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #1d2327;
}

.pt-form input[type="text"],
.pt-form input[type="email"],
.pt-form input[type="password"],
.pt-form input[type="tel"],
.pt-form input[type="date"],
.pt-form input[type="time"],
.pt-form input[type="number"],
.pt-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    color: #1d2327;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.pt-form input:focus,
.pt-form textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}

.pt-form textarea {
    resize: vertical;
    min-height: 80px;
}

.pt-required {
    color: #d63638;
}

/* Fieldsets */
.pt-fieldset {
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    padding: 20px 20px 4px;
    margin: 0 0 20px;
}

.pt-legend {
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
    padding: 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Multi-column rows */
.pt-field-row {
    display: grid;
    gap: 12px;
}

.pt-field-row-2 {
    grid-template-columns: 1fr 1fr;
}

.pt-field-row-3 {
    grid-template-columns: 2fr 1fr 1fr;
}

/* Toggle group (Delivery / Will Call) */
.pt-toggle-group {
    display: inline-flex;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    overflow: hidden;
}

.pt-toggle-btn {
    padding: 10px 24px;
    border: none;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: #1d2327;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.pt-toggle-btn + .pt-toggle-btn {
    border-left: 1px solid #c3c4c7;
}

.pt-toggle-btn:hover:not(:disabled) {
    background: #f0f0f1;
}

.pt-toggle-btn.pt-toggle-active {
    background: #2271b1;
    color: #fff;
}

.pt-toggle-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Field error highlight */
.pt-field-error {
    border-color: #d63638 !important;
    box-shadow: 0 0 0 2px rgba(214, 54, 56, 0.15) !important;
}

.pt-checkbox-field label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    cursor: pointer;
}

/* Buttons */
.pt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.15s, opacity 0.15s;
    text-decoration: none;
}

.pt-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pt-btn-primary {
    background: #2271b1;
    color: #fff;
    width: 100%;
}

.pt-btn-primary:hover:not(:disabled) {
    background: #135e96;
}

.pt-btn-secondary {
    background: #f0f0f1;
    color: #1d2327;
    border: 1px solid #c3c4c7;
}

.pt-btn-secondary:hover:not(:disabled) {
    background: #dcdcde;
}

.pt-btn-success {
    background: #00a32a;
    color: #fff;
    width: 100%;
    margin-top: 10px;
}

.pt-btn-success:hover:not(:disabled) {
    background: #008a20;
}

.pt-btn-small {
    padding: 6px 14px;
    font-size: 13px;
}

/* Alerts */
.pt-alert {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
}

.pt-alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.pt-alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.pt-alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Dropzone */
.pt-dropzone {
    border: 2px dashed #c3c4c7;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

.pt-dropzone:hover,
.pt-dropzone-active {
    border-color: #2271b1;
    background: rgba(34, 113, 177, 0.03);
}

.pt-dropzone-icon {
    color: #a7aaad;
    margin-bottom: 12px;
}

.pt-dropzone-text {
    font-size: 16px;
    font-weight: 500;
    color: #1d2327;
    margin: 0 0 8px;
}

.pt-dropzone-hint {
    font-size: 13px;
    color: #646970;
    margin: 0;
}

/* File List */
.pt-file-list {
    margin: 16px 0;
}

.pt-file-list h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pt-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    margin-bottom: 6px;
    background: #fafafa;
}

.pt-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.pt-file-name {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pt-file-size {
    font-size: 13px;
    color: #646970;
    white-space: nowrap;
}

.pt-file-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pt-file-remove {
    background: none;
    border: none;
    color: #a7aaad;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.pt-file-remove:hover {
    color: #d63638;
}

/* File Progress */
.pt-file-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pt-mini-progress {
    width: 80px;
    height: 6px;
    background: #e2e4e7;
    border-radius: 3px;
    overflow: hidden;
}

.pt-mini-fill {
    height: 100%;
    background: #2271b1;
    border-radius: 3px;
    width: 0;
    transition: width 0.2s;
}

.pt-file-status {
    font-size: 12px;
    color: #646970;
    min-width: 40px;
}

/* Overall Progress */
.pt-progress-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

.pt-progress-bar {
    flex: 1;
    height: 10px;
    background: #e2e4e7;
    border-radius: 5px;
    overflow: hidden;
}

.pt-progress-fill {
    height: 100%;
    background: #2271b1;
    border-radius: 5px;
    width: 0;
    transition: width 0.3s;
}

.pt-progress-text {
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
    min-width: 40px;
    text-align: right;
}

/* Status Badges */
.pt-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.pt-badge-active {
    background: #d4edda;
    color: #155724;
}

.pt-badge-pending {
    background: #fff3cd;
    color: #856404;
}

.pt-badge-expired {
    background: #e2e3e5;
    color: #6c757d;
}

.pt-badge-failed {
    background: #f8d7da;
    color: #721c24;
}

/* Table */
.pt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.pt-table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid #e2e4e7;
    font-weight: 600;
    color: #646970;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.pt-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f1;
}

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

/* Zebra stripes — skip hidden detail-expansion rows so they don't
   flash the wrong color when "View" is toggled open. */
.pt-table tbody .pt-job-row:nth-child(4n+3) {
    background: #eceef1;
}

.pt-table tbody tr:not(.pt-job-row):not(.pt-job-detail-row):nth-child(even) {
    background: #eceef1;
}

/* Jobs History */
.pt-jobs-history {
    margin-top: 8px;
}

.pt-job-actions {
    white-space: nowrap;
}

.pt-job-actions .pt-btn {
    margin-right: 4px;
}

.pt-job-detail-row td {
    padding: 0 12px 16px !important;
    background: #f9f9f9;
}

.pt-job-files-detail {
    padding: 8px 0;
}

.pt-job-files-detail .pt-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pt-job-notes-display {
    font-size: 13px;
    color: #646970;
    margin: 8px 0;
}

.pt-text-muted {
    color: #646970;
    font-size: 13px;
}

a.pt-file-download {
    color: #2271b1;
    text-decoration: none;
}

a.pt-file-download:hover {
    color: #135e96;
    text-decoration: underline;
}

/* Desktop Shortcut Link */
.pt-shortcut-link {
    text-align: center;
    margin: 0 0 16px;
}

.pt-shortcut-link a,
a#pt-shortcut-open {
    color: #2271b1;
    text-decoration: none;
    font-size: 13px;
}

.pt-shortcut-link a:hover,
a#pt-shortcut-open:hover {
    color: #135e96;
    text-decoration: underline;
}

.pt-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Desktop Shortcut Modal */
.pt-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}

.pt-modal {
    background: #fff;
    border-radius: 10px;
    padding: 32px;
    max-width: 380px;
    width: 90%;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.pt-modal h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #1d2327;
}

.pt-modal p {
    font-size: 14px;
    color: #646970;
    margin: 0 0 20px;
}

.pt-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #a7aaad;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.pt-modal-close:hover {
    color: #1d2327;
}

.pt-shortcut-drag {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    border: 2px solid #2271b1;
    border-radius: 8px;
    text-decoration: none;
    color: #1d2327;
    background: #f0f6fc;
    cursor: grab;
    transition: background-color 0.15s, box-shadow 0.15s;
}

.pt-shortcut-drag:hover {
    background: #e1effa;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.15);
}

.pt-shortcut-drag:active {
    cursor: grabbing;
}

.pt-shortcut-icon {
    color: #2271b1;
    display: flex;
}

.pt-shortcut-icon img {
    border-radius: 4px;
}

.pt-shortcut-label {
    font-size: 15px;
    font-weight: 600;
}

/* Login wrap — centered */
.pt-login-wrap .pt-portal-card {
    max-width: 420px;
    margin: 40px auto;
}

.pt-login-wrap .pt-portal-title,
.pt-login-wrap .pt-portal-subtitle {
    text-align: center;
}

.pt-login-wrap .pt-portal-subtitle {
    margin-bottom: 20px;
}

/* Responsive */
@media screen and (max-width: 600px) {
    .pt-portal {
        padding: 12px;
    }

    .pt-portal-card {
        padding: 16px;
    }

    .pt-portal-header {
        flex-direction: column;
        gap: 12px;
    }

    .pt-fieldset {
        padding: 16px 12px 4px;
    }

    .pt-field-row-2,
    .pt-field-row-3 {
        grid-template-columns: 1fr;
    }

    .pt-toggle-group {
        display: flex;
        width: 100%;
    }

    .pt-toggle-btn {
        flex: 1;
    }

    .pt-dropzone {
        padding: 24px 16px;
    }

    .pt-file-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .pt-mini-progress {
        width: 60px;
    }

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

    .pt-table th,
    .pt-table td {
        padding: 8px 6px;
    }
}
