/* R.A PetStylist — Client Waiver & Agreement CSS (Shared Theme) */

:root {
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Outfit', 'Inter', sans-serif;
    
    /* Animation Timing */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout Spacing */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
}

/* Light Theme Variables (Shared with index.html) */
body.light-mode {
    --bg-primary: #ffffff;
    --bg-secondary: #f9f9f9;
    --bg-alt: #f0f0f0;
    --border-color: rgba(0, 0, 0, 0.1);
    
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-muted: #666666;
    
    --color-primary: #000000;
    --color-primary-hover: #333333;
    --color-accent: #d4af37; /* Gold */
    --color-accent-hover: #b99523;
    
    /* Checkbox & radio button active success */
    --color-success: #d4af37; /* Gold */
    --color-success-hover: #b99523;
    --color-success-light: rgba(212, 175, 55, 0.08);

    /* Submit Button styling mapping */
    --btn-submit-bg: var(--color-primary);
    --btn-submit-text: #ffffff;
    --btn-submit-hover-bg: var(--color-accent);
    --btn-submit-hover-text: #000000;
}

/* Dark Theme Variables (Shared with index.html) */
body.dark-mode {
    --bg-primary: #000000;
    --bg-secondary: #111111;
    --bg-alt: #1a1a1a;
    --border-color: rgba(255, 255, 255, 0.1);
    
    --text-primary: #ffffff;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    
    --color-primary: #ffffff; 
    --color-primary-hover: #e5e5e5;
    --color-accent: #d4af37; /* Premium Gold */
    --color-accent-hover: #f1c40f;
    
    /* Checkbox & radio button active success */
    --color-success: #d4af37; /* Premium Gold */
    --color-success-hover: #f1c40f;
    --color-success-light: rgba(212, 175, 55, 0.1);

    /* Submit Button styling mapping */
    --btn-submit-bg: var(--color-primary);
    --btn-submit-text: #000000;
    --btn-submit-hover-bg: var(--color-accent);
    --btn-submit-hover-text: #000000;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    padding: 48px 24px;
    line-height: 1.5;
    transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

.waiver-app-container {
    max-width: 680px;
    margin: 0 auto;
}

/* Main Card */
.waiver-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 48px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    transition: background-color var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

@media (max-width: 576px) {
    .waiver-card {
        padding: 28px 20px;
    }
    body {
        padding: 20px 12px;
    }
}

/* Header */
.waiver-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-back {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: inline-block;
    transition: color var(--transition-fast);
}

.logo-back:hover {
    color: var(--color-primary);
}

.logo-accent {
    color: var(--color-accent);
}

/* Theme Toggle Button styling (Matches index.html) */
.theme-toggle-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

body.light-mode .moon-icon {
    display: block;
}
body.light-mode .sun-icon {
    display: none;
}

body.dark-mode .moon-icon {
    display: none;
}
body.dark-mode .sun-icon {
    display: block;
}

.theme-toggle-btn svg {
    width: 20px;
    height: 20px;
}

.waiver-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.25;
    margin-top: 12px;
    margin-bottom: 12px;
}

.waiver-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Form Sections */
.form-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 36px;
    margin-bottom: 36px;
}

.form-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.section-title-form {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title-form::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border-color);
}

.section-desc-form {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Form Grid Layout */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 576px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
select,
textarea {
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-alt);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(197, 168, 128, 0.15);
    background-color: var(--bg-secondary);
}

input[readonly] {
    background-color: var(--bg-primary);
    cursor: not-allowed;
    opacity: 0.8;
}

/* Pet Card Dynamic Render */
.pet-card {
    background-color: var(--bg-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 28px;
    margin-bottom: 28px;
    position: relative;
    animation: slideUp 0.3s ease;
    transition: all var(--transition-fast);
}

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

.pet-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.pet-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-remove-pet {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.btn-remove-pet:hover {
    background-color: rgba(239, 68, 68, 0.05);
    border-color: #ef4444;
}

/* Vaccine file upload box */
.vaccine-upload-area {
    margin-top: 12px;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.file-upload-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px dashed var(--color-primary);
    color: var(--text-primary);
    background-color: var(--bg-alt);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    width: fit-content;
}

.file-upload-label:hover {
    background-color: var(--color-success-light);
    border-color: var(--color-success);
    color: var(--color-success);
}

.file-name-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Add Pet Button styling */
.btn-add-pet-card {
    background-color: var(--bg-secondary);
    border: 1px dashed var(--color-accent);
    color: var(--color-accent);
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
    margin-bottom: 12px;
}

.btn-add-pet-card:hover {
    background-color: var(--bg-alt);
    border-color: var(--color-primary);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* Toggles segment styling */
.form-label-bold {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: block;
    font-size: 0.88rem;
}

.radio-btn-group {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.radio-btn {
    flex: 1;
    background-color: var(--bg-alt);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 14px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all var(--transition-fast);
    text-align: center;
}

.radio-btn:hover {
    border-color: var(--color-primary);
    color: var(--text-primary);
}

.radio-btn.active {
    background-color: var(--color-success);
    border-color: var(--color-success);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--color-success-light);
}

/* Custom Checkbox Design */
.check-block {
    margin-bottom: 24px;
}

.checkbox-container {
    display: flex;
    position: relative;
    padding-left: 36px;
    cursor: pointer;
    font-size: 0.92rem;
    line-height: 1.5;
    user-select: none;
    align-items: flex-start;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 2px;
    left: 0;
    height: 22px;
    width: 22px;
    background-color: var(--bg-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--color-primary);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--color-success);
    border-color: var(--color-success);
}

.checkmark::after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark::after {
    display: block;
}

.checkbox-container .checkmark::after {
    left: 8px;
    top: 4px;
    width: 5px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    color: var(--text-secondary);
    font-weight: 500;
}

.checkbox-container input:required ~ .checkbox-text::after {
    content: " *";
    color: #ef4444;
}

/* Liability agreement text block */
.waiver-box-container {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-alt);
    padding: 24px;
}

.waiver-text-box {
    max-height: 240px;
    overflow-y: auto;
    padding-right: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.waiver-text-box h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.waiver-text-box ol {
    padding-left: 24px;
    margin: 16px 0;
    display: grid;
    gap: 12px;
}

/* Signature Drawing Canvas */
.signature-group {
    margin-bottom: 24px;
}

.signature-pad-wrapper {
    position: relative;
    width: 100%;
}

#signature-pad {
    background-color: #ffffff; /* Remains white in both modes to contrast dark ink drawing */
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    width: 100%;
    height: 180px;
    display: block;
    cursor: crosshair;
    touch-action: none;
}

.sig-pad-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.required-indicator {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

.btn-clear-sig {
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 8px;
    transition: opacity var(--transition-fast);
}

.btn-clear-sig:hover {
    opacity: 0.85;
}

/* Client Portal Optional Password section */
.portal-opt-section {
    margin-bottom: 40px;
}

.portal-box {
    background-color: var(--color-success-light);
    border: 1px solid rgba(20, 184, 166, 0.12);
    border-radius: var(--radius-sm);
    padding: 28px;
}

.portal-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-success);
    margin-bottom: 8px;
}

.optional-tag {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.portal-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Submit Area & Action Button */
.form-submit-area {
    margin-top: 40px;
    text-align: center;
}

.btn-submit-agreement {
    font-family: var(--font-body);
    background-color: var(--btn-submit-bg);
    color: var(--btn-submit-text);
    border: none;
    border-radius: var(--radius-sm);
    padding: 18px 40px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.btn-submit-agreement:hover {
    background-color: var(--btn-submit-hover-bg);
    color: var(--btn-submit-hover-text);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.btn-submit-agreement:disabled {
    background-color: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Footer elements */
.waiver-footer {
    text-align: center;
    margin-top: 40px;
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 500;
}

/* ------------------------------------- */
/* Multi-step Wizard Styles */
/* ------------------------------------- */

.wizard-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
}

.wizard-progress::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--border-color);
    transform: translateY(-50%);
    z-index: 0;
}

.wizard-step-indicator {
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
    transition: all var(--transition-fast);
}

.wizard-step-indicator.active {
    border-color: var(--color-accent);
    background-color: var(--color-accent);
    color: var(--bg-secondary);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.wizard-step-indicator.completed {
    border-color: var(--color-accent);
    background-color: var(--bg-secondary);
    color: var(--color-accent);
}

.form-step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.form-step.active {
    display: block;
}

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

.step-buttons-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.btn-step {
    background-color: var(--bg-alt);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-step:hover {
    background-color: var(--border-color);
}

.btn-step-next {
    background-color: var(--color-accent);
    color: var(--bg-primary);
    border: none;
}

.btn-step-next:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-2px);
}

/* Extras grid styling */
.extras-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .extras-grid {
        grid-template-columns: 1fr;
    }
}
