/**
 * Pure Meal Prep — Subscription Modal Styles
 * Complete rebuild per spec
 */

/* ===========================
   BASE MODAL
   =========================== */
.pmps-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    inset: 0;
    align-items: center;
    justify-content: center;
}

.pmps-modal[style*="display: block"],
.pmps-modal[style*="display:block"] {
    display: flex !important;
}

.pmps-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

.pmps-modal-content {
    position: relative;
    background: #fff;
    border-radius: 14px;
    max-width: 520px;
    width: calc(100% - 32px);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    animation: pmpsSlideUp 0.28s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes pmpsSlideUp {
    from { transform: translateY(24px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ===========================
   HEADER
   =========================== */
.pmps-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 24px 0;
}

.pmps-modal-header h2 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
}

.pmps-subtitle {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.pmps-modal-close {
    background: none;
    border: none;
    font-size: 26px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0 0 0 12px;
    transition: color 0.15s;
    flex-shrink: 0;
    margin-top: -2px;
}

.pmps-modal-close:hover {
    color: #333;
}

/* ===========================
   BODY
   =========================== */
.pmps-modal-body {
    padding: 20px 24px 24px;
}

.pmps-step {
    animation: pmpsFadeIn 0.2s ease;
}

@keyframes pmpsFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===========================
   REASONS LIST (Step 1)
   =========================== */
.pmps-reasons-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
}

.pmps-reason-item label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}

.pmps-reason-item label:hover {
    border-color: #899c40;
    background: #f7f9ed;
}

.pmps-reason-item input[type="radio"] {
    accent-color: #899c40;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}

.pmps-reason-item input[type="radio"]:checked ~ .pmps-reason-text {
    color: #899c40;
    font-weight: 600;
}

.pmps-reason-item:has(input:checked) label {
    border-color: #899c40;
    background: #f5f7eb;
}

.pmps-reason-icon {
    font-size: 20px;
    width: 26px;
    text-align: center;
    flex-shrink: 0;
}

.pmps-reason-text {
    font-size: 14px;
    color: #333;
    flex: 1;
}

/* ===========================
   OPTION CARDS (Step 2 flows)
   =========================== */
.pmps-option-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
}

.pmps-option-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    font-family: inherit;
}

.pmps-option-card:hover {
    border-color: #899c40;
    background: #f5f7eb;
    transform: translateX(3px);
}

.pmps-option-card:active {
    transform: translateX(0);
}

.pmps-oc-icon {
    font-size: 22px;
    flex-shrink: 0;
    width: 30px;
    text-align: center;
}

.pmps-oc-label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    flex: 1;
}

.pmps-oc-desc {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
    display: block;
}

.pmps-option-card .pmps-oc-label,
.pmps-option-card .pmps-oc-desc {
    display: block;
}

.pmps-option-card span:not(.pmps-oc-icon) {
    flex: 1;
}

/* ===========================
   PAUSE BUTTONS (Step 3)
   =========================== */
.pmps-pause-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
}

.pmps-pause-pick {
    display: block;
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    text-align: left;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.pmps-pause-pick:hover {
    border-color: #899c40;
    background: #f5f7eb;
    transform: translateX(3px);
}

.pmps-pause-pick.pmps-pause-nevermind {
    color: #666;
    font-weight: 400;
    border-color: transparent;
    background: transparent;
    font-size: 13px;
    text-align: center;
    padding: 8px;
}

.pmps-pause-pick.pmps-pause-nevermind:hover {
    color: #333;
    text-decoration: underline;
    background: transparent;
    border-color: transparent;
    transform: none;
}

.pmps-pause-pick.pmps-active {
    border-color: #899c40;
    background: #f5f7eb;
    color: #899c40;
}

/* ===========================
   OPTIONAL REASON (Pause step)
   =========================== */
.pmps-optional-label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin: 0 0 10px;
}

.pmps-pause-reason-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pmps-radio-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.12s;
}

.pmps-radio-row:hover {
    background: #f5f5f5;
}

.pmps-radio-row input[type="radio"] {
    accent-color: #899c40;
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    cursor: pointer;
}

/* ===========================
   MICRO SUGGESTIONS
   =========================== */
.pmps-micro-suggestion {
    background: #f7f9ed;
    border: 1px solid #c9d47a;
    border-radius: 10px;
    padding: 14px 16px;
}

.pmps-micro-suggestion p {
    margin: 0 0 10px;
    font-size: 13px;
    color: #444;
}

.pmps-micro-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pmps-micro-btn {
    padding: 9px 14px;
    border: 1px solid #c9d47a;
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    text-align: left;
    font-family: inherit;
    transition: background 0.12s, border-color 0.12s;
    color: #899c40;
    font-weight: 500;
}

.pmps-micro-btn:hover {
    background: #f5f7eb;
    border-color: #899c40;
}

/* ===========================
   DATE INPUT
   =========================== */
.pmps-field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.pmps-date-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.15s;
}

.pmps-date-input:focus {
    outline: none;
    border-color: #899c40;
    box-shadow: 0 0 0 3px rgba(137,156,64,0.12);
}

/* ===========================
   PAUSE CONFIRMATION SCREEN
   =========================== */
.pmps-confirm-details {
    background: #f7f9ed;
    border: 1px solid #c9d47a;
    border-radius: 10px;
    padding: 16px 20px;
    margin: 16px 0;
    text-align: left;
}

.pmps-confirm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #edf0d5;
    font-size: 14px;
}

.pmps-confirm-row:last-child {
    border-bottom: none;
}

.pmps-confirm-label {
    color: #666;
}

.pmps-confirm-value {
    font-weight: 700;
    color: #899c40;
}

.pmps-reassurance {
    font-size: 13px;
    color: #555;
    line-height: 1.9;
    margin: 16px 0;
}

/* ===========================
   BUTTONS
   =========================== */
.pmps-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.pmps-btn:active {
    transform: scale(0.97);
}

.pmps-btn-primary {
    background: #899c40;
    color: #fff;
}

.pmps-btn-primary:hover {
    background: #899c40;
    box-shadow: 0 4px 12px rgba(137,156,64,0.35);
}

.pmps-btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.pmps-btn-danger {
    background: transparent;
    color: #b71c1c;
    border: 1.5px solid #ef9a9a;
    font-weight: 500;
    font-size: 13px;
}

.pmps-btn-danger:hover {
    background: #fef2f2;
    border-color: #e57373;
}

.pmps-btn-ghost {
    background: transparent;
    color: #666;
    border: 1.5px solid #e0e0e0;
    font-weight: 500;
    font-size: 13px;
}

.pmps-btn-ghost:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

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

/* ===========================
   MODAL ACTIONS ROW
   =========================== */
.pmps-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.pmps-actions-split {
    justify-content: space-between;
    align-items: center;
}

.pmps-actions-center {
    justify-content: center;
}

/* ===========================
   TEXT HELPERS
   =========================== */
.pmps-text-center {
    text-align: center;
}

.pmps-big-text {
    font-size: 16px;
    color: #333;
    margin: 16px 0 8px;
    line-height: 1.5;
}

/* ===========================
   LOADING
   =========================== */
#pmps-loading-overlay,
#pmps-standalone-loading {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
}

.pmps-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-size: 14px;
    padding: 20px 0;
}

.pmps-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid #e0e0e0;
    border-top-color: #899c40;
    border-radius: 50%;
    animation: pmpsSpin 0.7s linear infinite;
    flex-shrink: 0;
}

.pmps-spinner-lg {
    width: 36px;
    height: 36px;
    border-width: 4px;
}

@keyframes pmpsSpin {
    to { transform: rotate(360deg); }
}

/* ===========================
   CANCEL BTN (on page)
   =========================== */
a.pmps-cancel-subscription-btn,
button.pmps-cancel-subscription-btn {
    background-color: #899c40 !important;
    color: #fff !important;
    border-color: #899c40 !important;
    padding: 10px 18px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: background 0.15s !important;
    margin: 0 6px !important;
}

a.pmps-cancel-subscription-btn:hover,
button.pmps-cancel-subscription-btn:hover {
    background-color: #899c40 !important;
    border-color: #899c40 !important;
    opacity: 0.88 !important;
}

a.pmps-pause-subscription-btn,
button.pmps-pause-subscription-btn {
    background-color: #899c40 !important;
    color: #fff !important;
    border-color: #899c40 !important;
    padding: 10px 18px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: background 0.15s !important;
    margin: 0 6px !important;
}

a.pmps-pause-subscription-btn:hover,
button.pmps-pause-subscription-btn:hover {
    background-color: #899c40 !important;
    border-color: #899c40 !important;
    opacity: 0.88 !important;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 560px) {
    .pmps-modal-content {
        border-radius: 12px 12px 0 0;
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 85vh;
        max-width: 100%;
        width: 100%;
    }

    .pmps-modal {
        align-items: flex-end;
    }

    @keyframes pmpsSlideUp {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }

    .pmps-modal-header h2 {
        font-size: 19px;
    }

    .pmps-actions-split {
        flex-wrap: wrap;
    }
}
