/* Affidavit Workflow Styles */

/* Header Modifications */
.header-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.header-left .back-link {
    flex-basis: 100%;
}

.header-left .header-logo {
    height: 28px;
    width: auto;
    flex-shrink: 0;
}

.back-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--white);
}

/* Phase Progress Bar */
.phase-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 20px;
    padding: 16px 0;
}

.phase-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.phase-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.phase-step.active .phase-number {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
}

.phase-step.completed .phase-number {
    background: var(--success);
    color: var(--white);
}

.phase-step.completed .phase-number::after {
    content: "\2713";
}

.phase-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.phase-step.active .phase-label,
.phase-step.completed .phase-label {
    color: var(--white);
}

.phase-connector {
    width: 60px;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 8px;
    margin-bottom: 22px;
}

.phase-connector.completed {
    background: var(--success);
}

/* Workflow Main Layout */
.workflow-main {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    padding: 24px 32px;
    max-width: 1400px;
    margin: 0 auto;
}

.workflow-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* Workflow Phases */
.workflow-phase {
    display: none;
    padding: 32px;
}

.workflow-phase.active {
    display: block;
}

.phase-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.phase-header h2 {
    font-size: 1.5rem;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.phase-header p {
    color: var(--gray-500);
    font-size: 0.95rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.radio-group {
    display: flex;
    gap: 24px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.field-hint {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 6px;
    font-style: italic;
}

.field-hint.strong {
    color: var(--success);
    font-weight: 500;
}

/* Conditional Fields */
.conditional {
    background: var(--gray-50);
    padding: 16px;
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
    margin-top: 12px;
}

/* Anecdote Guidance */
.anecdote-guidance {
    background: #eff6ff;
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    border-left: 4px solid var(--primary);
}

.anecdote-guidance strong {
    color: var(--primary);
    display: block;
    margin-bottom: 8px;
}

.anecdote-guidance ul {
    margin: 0;
    padding-left: 20px;
    color: var(--gray-700);
}

.anecdote-guidance li {
    margin-bottom: 4px;
}

/* Workflow Navigation */
.workflow-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

.nav-spacer {
    flex: 1;
}

.btn-primary,
.btn-secondary,
.btn-success,
.btn-outline {
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #15803d;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-600);
}

.btn-outline:hover {
    background: var(--gray-100);
}

.btn-full {
    width: 100%;
    margin-top: 8px;
}

/* Drafts Sidebar */
.drafts-sidebar {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 24px;
}

.drafts-sidebar h3 {
    font-size: 1rem;
    color: var(--gray-800);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.no-drafts {
    color: var(--gray-400);
    font-size: 0.9rem;
    text-align: center;
    padding: 20px 0;
}

.draft-item {
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.draft-item:hover {
    background: var(--gray-100);
}

.draft-item-name {
    font-weight: 500;
    color: var(--gray-800);
    font-size: 0.9rem;
}

.draft-item-date {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 4px;
}

.draft-item-type {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 8px;
    background: var(--primary);
    color: var(--white);
    border-radius: 10px;
    margin-top: 6px;
}

/* Phase 5: Generation */
.strength-report {
    background: var(--gray-50);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.strength-report h3 {
    font-size: 1rem;
    color: var(--gray-800);
    margin-bottom: 16px;
}

.strength-indicators {
    display: grid;
    gap: 8px;
}

.strength-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius);
}

.strength-item.positive {
    background: #dcfce7;
    color: var(--success);
}

.strength-item.negative {
    background: #fef3c7;
    color: var(--warning);
}

.strength-icon {
    font-size: 1.2rem;
}

.missing-elements {
    background: #fef3c7;
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    border-left: 4px solid var(--warning);
}

.missing-elements h3 {
    color: var(--warning);
    font-size: 1rem;
    margin-bottom: 12px;
}

.missing-elements ul {
    margin: 0;
    padding-left: 20px;
    color: var(--gray-700);
}

.input-summary {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}

.input-summary h3 {
    font-size: 1rem;
    color: var(--gray-800);
    margin-bottom: 16px;
}

.summary-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-100);
}

.summary-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.summary-label {
    font-size: 0.8rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.summary-value {
    color: var(--gray-800);
    font-size: 0.95rem;
}

/* Affidavit Preview */
.affidavit-preview {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.affidavit-preview h3 {
    font-size: 1rem;
    color: var(--gray-800);
    padding: 16px 20px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    margin: 0;
}

.preview-actions {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.preview-content {
    padding: 24px;
    max-height: 600px;
    overflow-y: auto;
    font-family: 'Times New Roman', serif;
    line-height: 1.8;
    color: var(--gray-800);
}

.preview-content h4 {
    font-size: 1.1rem;
    margin: 24px 0 12px 0;
    color: var(--gray-900);
}

.preview-content h4:first-child {
    margin-top: 0;
}

.preview-content p {
    margin-bottom: 16px;
    text-align: justify;
}

.preview-content .signature-block {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-300);
}

.preview-content .signature-line {
    border-bottom: 1px solid var(--gray-800);
    width: 300px;
    margin: 30px 0 5px 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .workflow-main {
        grid-template-columns: 1fr;
    }

    .drafts-sidebar {
        position: static;
        order: -1;
    }

    .phase-progress {
        flex-wrap: wrap;
        gap: 8px;
    }

    .phase-connector {
        display: none;
    }
}

@media (max-width: 768px) {
    .workflow-main {
        padding: 16px;
    }

    .workflow-phase {
        padding: 20px;
    }

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

    .workflow-nav {
        flex-wrap: wrap;
        gap: 12px;
    }

    .btn-primary,
    .btn-secondary,
    .btn-success {
        flex: 1;
        text-align: center;
    }
}

/* Email Entry Screen (Phase 0) */
.email-entry-card {
    max-width: 500px;
    margin: 0 auto;
    padding: 40px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    text-align: center;
}

.email-entry-card .form-group {
    text-align: left;
    margin-bottom: 24px;
}

.email-entry-card input[type="email"] {
    font-size: 1.1rem;
    padding: 14px 18px;
}

.email-actions {
    margin-top: 24px;
}

.email-actions .btn-primary {
    width: 100%;
    padding: 14px 24px;
    font-size: 1.1rem;
}

.privacy-note {
    margin-top: 20px;
    color: var(--gray-500);
}

.session-status {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.session-status h4 {
    margin: 0 0 12px 0;
    color: var(--primary);
    font-size: 1rem;
}

.session-status p {
    margin: 8px 0;
    color: var(--gray-600);
    font-size: 0.9rem;
}

.session-status .session-meta {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
}

.session-status .session-meta span {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.session-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.session-actions button {
    flex: 1;
}

/* Auto-save indicator */
.save-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 16px;
    background: var(--gray-800);
    color: var(--white);
    border-radius: var(--radius);
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1000;
}

.save-indicator.visible {
    opacity: 1;
}

.save-indicator.success {
    background: var(--success);
}

.save-indicator.error {
    background: var(--danger);
}

/* Welcome Instructions Card */
.welcome-instructions-card {
    max-width: 600px;
    margin: 0 auto 24px auto;
    padding: 24px 32px;
    background: #eff6ff;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary);
}

.welcome-instructions-card h3 {
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.welcome-instructions-card p {
    color: var(--gray-700);
    margin-bottom: 16px;
}

.welcome-instructions-card ol {
    margin: 0 0 20px 0;
    padding-left: 24px;
    color: var(--gray-700);
}

.welcome-instructions-card ol li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.submission-instructions {
    background: var(--white);
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-top: 16px;
}

.submission-instructions h4 {
    color: var(--gray-800);
    font-size: 1rem;
    margin-bottom: 12px;
}

.submission-instructions p {
    margin: 8px 0;
    color: var(--gray-700);
}

.submission-instructions a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.submission-instructions a:hover {
    text-decoration: underline;
}

.submission-instructions address {
    font-style: normal;
    background: var(--gray-50);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-top: 8px;
    color: var(--gray-700);
    line-height: 1.6;
}

.optional-id-request {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-left: 4px solid #0ea5e9;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-top: 16px;
}

.optional-id-request p {
    margin: 0;
    color: var(--gray-700);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Email Entry Card Title */
.email-entry-card h3 {
    color: var(--gray-800);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Alternative Template Card */
.alternative-template-card {
    max-width: 600px;
    margin: 24px auto 0 auto;
    padding: 24px 32px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--gray-300);
}

.alternative-template-card h3 {
    color: var(--gray-700);
    font-size: 1rem;
    margin-bottom: 12px;
}

.alternative-template-card p {
    color: var(--gray-600);
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.alternative-template-card ul {
    margin: 0 0 16px 0;
    padding-left: 20px;
    color: var(--gray-600);
    font-size: 0.9rem;
}

.alternative-template-card ul li {
    margin-bottom: 4px;
}

.template-download-actions {
    text-align: center;
    margin-top: 16px;
}

.template-download-actions .btn-outline {
    display: inline-block;
    text-decoration: none;
}

/* Generate Page Cards */
.generate-thank-you {
    background: #dcfce7;
    padding: 20px 24px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    border-left: 4px solid var(--success);
}

.generate-thank-you h3 {
    color: var(--success);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.generate-thank-you p {
    color: var(--gray-700);
    margin: 0;
}

.next-steps-card {
    background: #eff6ff;
    padding: 24px;
    border-radius: var(--radius);
    margin-top: 24px;
    border-left: 4px solid var(--primary);
}

.next-steps-card h3 {
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.next-steps-card ol {
    margin: 0 0 20px 0;
    padding-left: 24px;
    color: var(--gray-700);
}

.next-steps-card ol li {
    margin-bottom: 10px;
    line-height: 1.5;
}

/* Notary Section Styling in Preview */
.preview-content .notary-section {
    margin-top: 40px;
    padding: 20px;
    border: 2px solid var(--gray-400);
    border-radius: var(--radius);
    background: var(--gray-50);
}

.preview-content .notary-section h4 {
    text-align: center;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--gray-300);
    padding-bottom: 12px;
}

.preview-content .notary-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 16px;
}

.preview-content .notary-field {
    margin-bottom: 12px;
}

.preview-content .notary-field-line {
    border-bottom: 1px solid var(--gray-600);
    min-height: 30px;
    margin-bottom: 4px;
}

.preview-content .notary-field-label {
    font-size: 0.85rem;
    color: var(--gray-600);
}
