/* ====== Trial Creation Step Pages Styling ====== */

/* Override dark theme CSS variables for trial pages ONLY */
:root:has(.wizard-stepper) {
    --pf-bg-primary: #f5f5f5 !important;
    --pf-text-primary: #333333 !important;
}

/* Override dark theme for trial pages */
html:has(.wizard-stepper) {
    background-color: #f5f5f5 !important;
}

body:has(.wizard-stepper) {
    background-color: #f5f5f5 !important;
}

/* Container */
.trials-container {
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.wizard-content {
    border-top: none;
}

/* Stepper Navigation - Now INSIDE page */
.wizard-stepper {
    --step-gap: clamp(10px, 4vw, 28px);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 0.75rem;
    padding: 1.25rem 1rem;
    background: #ffffff !important;
    border-bottom: none;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 100%;
}

.wizard-stepper > div {
    display: flex;
    gap: var(--step-gap);
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    max-width: 480px;
    justify-self: center;
    order: 2;
}

@media (min-width: 768px) {
    .wizard-stepper {
        padding: 1.5rem;
        --step-gap: clamp(14px, 2.2vw, 32px);
    }

    .wizard-stepper > div {
        max-width: 520px;
    }
}

.wizard-stepper .back-arrow {
    width: clamp(32px, 8vw, 38px);
    height: clamp(32px, 8vw, 38px);
    background: #003DA5;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1rem, 3.4vw, 1.2rem);
    font-weight: 700;
    cursor: pointer;
    color: #ffffff;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: static;
    order: 1;
    justify-self: start;
}

.wizard-stepper .back-arrow:hover:not(:disabled) {
    background: #002d7a;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 61, 165, 0.3);
}

.wizard-stepper .back-arrow:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 61, 165, 0.2);
}

.wizard-stepper .back-arrow:disabled {
    background: #003DA5;
    color: #ffffff;
    cursor: default;
    opacity: 1;
}

.wizard-stepper .forward-arrow {
    display: none;
}

.back-arrow,
.forward-arrow {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    color: #999;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-arrow:hover:not(:disabled) {
    color: #003d99;
}

.back-arrow:disabled {
    opacity: 1;
    color: #ffffff;
    cursor: default;
}

.forward-arrow:hover:not(:disabled) {
    color: #003d99;
}

.forward-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Stepper Dots */
.step {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #eef0f4;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    font-weight: 600;
    color: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0;
    min-width: 22px;
    z-index: 2;
    margin: 0;
}

.step:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 61, 153, 0.2);
}

/* chevron inside future steps */
.step::after {
    content: '\203A';
    font-size: 0.85rem;
    font-weight: 700;
    color: #1a1a4e;
    line-height: 1;
}

.step:hover {
    background: #e0e3e9;
}

.step.active {
    width: 24px;
    height: 24px;
    min-width: 24px;
    background: #16a34a;
    color: transparent;
    box-shadow: none;
}

.step.active::after {
    content: '';
}

.step.completed {
    background: #16a34a;
    color: transparent;
}

.step.completed::after {
    content: '\2713';
    color: #ffffff;
    font-size: 0.7rem;
}

/* Connecting line between steps */
.step::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    width: var(--step-gap);
    height: 2px;
    background: #d9dde3;
    z-index: 1;
}

.step:first-child::before {
    display: none;
}

.step.completed::before {
    background: #16a34a;
}

.step.active::before {
    background: #d9dde3;
}

/* Main Content */
.wizard-content {
    flex: 1;
    padding: 0;
    background-color: #ffffff !important;
    display: flex;
    justify-content: center;
    overflow-y: auto;
}

.trial-step {
    width: 100%;
    max-width: 100%;
    background: #ffffff;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 100px);
    padding: 0;
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}

.trial-step-content {
    padding: 2rem 1.5rem;
    flex: 1;
}

.pf-shell-content:has(.wizard-content) {
    padding: 0 !important;
}

.trial-step h2 {
    color: #1a1a1a;
}

.trial-step .trial-step-label {
    color: #00a857;
}

.trial-step .trial-step-description {
    color: #666;
}

/* Step Header */
.trial-step-header {
    margin-bottom: 2.5rem;
    text-align: center;
    padding: 0 1rem;
}

.trial-step-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: #00a857;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    display: none;
    text-transform: uppercase;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.trial-step-icon-wrapper {
    width: auto;
    height: auto;
    margin: 0 auto 2rem;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.trial-step-icon-wrapper img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.trial-step h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.trial-step-description {
    font-size: 0.85rem;
    color: #666;
    margin: 0 0 2rem 0;
    line-height: 1.5;
}

/* Form Fields */
.trial-field {
    margin-bottom: 1.25rem;
}

.trial-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.trial-field input,
.trial-field select,
.trial-field textarea {
    width: 100%;
    padding: 0.7rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    background: #ffffff;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.trial-field input:focus,
.trial-field select:focus,
.trial-field textarea:focus {
    outline: none;
    border-color: #003d99;
    box-shadow: 0 0 0 3px rgba(0, 61, 153, 0.1);
}

.trial-field input::placeholder,
.trial-field textarea::placeholder {
    color: #999;
}

.trial-field textarea {
    resize: vertical;
    min-height: 90px;
    font-family: inherit;
}

.trial-field.optional label::after {
    content: " (Optional)";
    font-weight: 400;
    color: #999;
}

/* Character Counter */
.char-counter {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.25rem;
    text-align: right;
}

/* Toggle Buttons for Gender/All */
.toggle-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.toggle-btn {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    background: #ffffff;
    color: #333;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn:hover {
    border-color: #003d99;
}

.toggle-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 61, 153, 0.1);
    border-color: #003d99;
}

.toggle-btn.active {
    background: #003DA5;
    border-color: #003DA5;
    color: white;
}

.toggle-btn.active:focus {
    box-shadow: 0 0 0 3px rgba(0, 61, 165, 0.2);
}

/* Age Range Input */
.age-range-input {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.age-range-input > div {
    flex: 1;
}

.age-range-input label {
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
    display: block;
}

.age-range-input input,
.age-range-input select {
    width: 100%;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 0.2rem;
    cursor: pointer;
    accent-color: #003d99;
    flex-shrink: 0;
}

.checkbox-group label {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
    cursor: pointer;
}

/* Review List */
.review-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-top: none;
}

.review-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid #dde5f0;
    border-radius: 10px;
    background: #ffffff;
}

.review-left {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.review-icon {
    font-size: 1.1rem;
    color: #202d59;
    flex-shrink: 0;
    width: 1.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin-top: 0.08rem;
}

.review-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.review-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1b2240;
    line-height: 1.2;
    margin-bottom: 0.2rem;
}

.review-value {
    font-size: 0.95rem;
    color: #384466;
    line-height: 1.35;
    word-break: break-word;
}

.review-row:nth-child(1) .review-icon,
.review-row:nth-child(2) .review-icon,
.review-row:nth-child(3) .review-icon,
.review-row:nth-child(4) .review-icon,
.review-row:nth-child(5) .review-icon,
.review-row:nth-child(6) .review-icon,
.review-row:nth-child(7) .review-icon,
.review-row:nth-child(8) .review-icon {
    transform: translateY(1px);
}

.review-edit {
    background: none;
    border: none;
    color: #0b4ed8;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 0.15rem;
}

.review-edit:hover {
    text-decoration: underline;
}

.review-edit:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(11, 78, 216, 0.3);
    border-radius: 2px;
}

.review-confirm {
    margin-top: 1rem;
    margin-bottom: 1rem;
    background: transparent;
    padding: 0;
    gap: 0.6rem;
    border-radius: 0;
}

.review-confirm input[type="checkbox"] {
    margin-top: 0.05rem;
}

.review-confirm label {
    color: #1f294b;
    font-size: 0.95rem;
    font-weight: 600;
}

/* Action Buttons */
.trial-actions {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    padding: 1rem 0;
    border-top: none;
    flex-wrap: wrap;
    background: #ffffff;
    position: sticky;
    bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}

.trial-actions .btn {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trial-actions .btn:focus {
    outline: none;
}

.btn-primary {
    background: #003d99;
    color: white;
    flex: 1;
}

.btn-primary:hover:not(:disabled) {
    background: #002d73;
}

.btn-primary:focus:not(:disabled) {
    box-shadow: 0 0 0 3px rgba(0, 61, 153, 0.2);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    flex: 1;
}

.btn-secondary:hover {
    background: #e8e8e8;
}

.btn-secondary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 61, 153, 0.1);
    border-color: #003d99;
}

/* Success Container */
.success-container {
    width: 100%;
    max-width: none;
    margin: 0;
    text-align: center;
}

.success-step-page {
    width: 100%;
    max-width: 100%;
}

.success-step-page .trial-step-content {
    width: 100%;
}

.success-stepper-wrap {
    width: 100%;
    padding: 0.7rem 1rem 0.25rem;
}

.success-stepper-dots {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    width: 100%;
    margin: 0;
    padding: 0.2rem 0 0.5rem;
}

.success-stepper-dots span {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #16a34a;
    position: relative;
    z-index: 1;
}

.success-stepper-dots::before {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    top: 50%;
    height: 2px;
    transform: translateY(-50%);
    background: #16a34a;
    z-index: 0;
}

.success-next-card {
    margin-top: 0.8rem;
    text-align: left;
    background: #f8fbff;
    border: 1px solid #e4ebf7;
    border-radius: 12px;
    padding: 1rem;
    width: 100%;
}

.success-next-card h3 {
    font-size: 1.05rem;
    color: #172040;
    font-weight: 800;
    margin: 0 0 0.85rem;
}

.success-next-item {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    color: #253358;
    font-size: 0.95rem;
    line-height: 1.4;
}

.success-next-item + .success-next-item {
    margin-top: 0.8rem;
}

.success-next-item i {
    color: #1f5bdb;
    font-size: 1.05rem;
    margin-top: 0.12rem;
}

.success-step-page .trial-step-icon-wrapper img {
    width: clamp(120px, 32vw, 150px);
    height: clamp(120px, 32vw, 150px);
}

.success-actions {
    justify-content: center;
}

.success-actions .btn {
    width: 100%;
    max-width: none;
    flex: 1 1 100%;
}

.success-actions .btn-secondary {
    background: #0b49d1;
    border-color: #0b49d1;
    color: #ffffff;
}

.success-actions .btn-secondary:hover {
    background: #083aa8;
}

/* Desktop Breakpoints */
@media (min-width: 640px) {
    .trials-container {
        padding-bottom: 0;
    }

    .wizard-stepper {
        padding: 1.5rem 2rem;
    }

    .trial-step {
        padding: 2rem;
        max-width: 600px;
        margin: 0 auto;
    }

    .trial-step h2 {
        font-size: 1.75rem;
    }

    .trial-actions {
        padding: 2rem 0;
        bottom: 0;
    }

    .trial-actions .btn {
        min-height: 48px;
        font-size: 1rem;
    }

    .toggle-group {
        gap: 1rem;
    }

    .age-range-input {
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .trial-step {
        padding: 3rem;
        max-width: 700px;
    }

    .trials-container {
        padding-bottom: 0;
    }

    .trial-step h2 {
        font-size: 2rem;
    }
}
