/*
 * Utilifarm sign-up page (App/Views/Accounts/register.html): the form card,
 * its steps and fields. Moved out of the page's inline <style> (UI/UX plan,
 * Phase 1, 2026-10-29) and put on the site's palette (css/public.css).
 */
/* The page's own names for the site's palette (css/public.css), on its wrapper only. */
.registration-wrapper {
    --primary-color: var(--primary);
    --accent-color: var(--warm);
    --accent-light: #f0bb5d;
    --text-dark: var(--ink);
    --text-light: var(--muted);
    --gray-light: var(--cream);
    --gray-border: #e6e0d4;
    --warning: #fb8c00;
}

/* Registration Wrapper */
.registration-wrapper {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px 64px;
    background: linear-gradient(180deg, var(--cream) 0%, var(--cream-warm) 100%);
}

.registration-content {
    width: 100%;
    max-width: 800px;
}

.registration-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

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

/* Header */
.registration-header {
    background: linear-gradient(160deg, var(--primary-deeper) 0%, var(--primary-dark) 60%, var(--primary) 100%);
    padding: 40px 30px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.registration-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255, 160, 0, 0.1);
    border-radius: 50%;
}

.registration-header-content {
    position: relative;
    z-index: 1;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.logo-icon {
    font-size: 48px;
    color: white;
}

.registration-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0;
    color: white;
}

.brand-tagline {
    font-size: 16px;
    opacity: 0.9;
    margin: 10px 0 0 0;
    font-weight: 400;
}

/* Progress Steps */
.step-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 20px 16px;
    list-style: none;
    background: var(--gray-light);
}

.step { flex: 1; max-width: 120px; list-style: none; }

.step-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 4px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: #6b6b6b;
    font: inherit;
    cursor: pointer;
}
.step-button:disabled { cursor: default; }
.step-button:focus { background: none; }
.step-button:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }

.step-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    background: white;
    color: #6b6b6b;
    border: 2px solid var(--gray-border);
}

.step-label { font-size: 12px; white-space: nowrap; }

.step.is-current .step-circle {
    background: var(--accent-color);
    color: var(--text-dark);
    border-color: var(--accent-color);
}
.step.is-current .step-label { color: var(--primary-color); font-weight: 600; }

.step.is-done .step-circle {
    background: var(--success);
    color: white;
    border-color: var(--success);
}
.step.is-done .step-label { color: var(--text-dark); text-decoration: underline; }

/* Form Body */
.registration-body {
    padding: 40px;
}

.form-section {
    margin-bottom: 32px;
}

.form-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* The fields: label above a full-width box (css/public.css). */
.registration-wrapper input.form-control,
.registration-wrapper select.form-control {
    display: block;
    width: 100%;
    box-sizing: border-box;
    height: auto;
    min-height: 46px;
    padding: 0.65rem 0.9rem;
    margin: 0;
    font: inherit;
    font-size: 1rem;
    color: var(--ink);
    background: #fff;
    border: 1.5px solid rgba(15,26,26,0.18);
    border-radius: 10px;
    box-shadow: none;
}
.registration-wrapper input.form-control:focus:not([readonly]),
.registration-wrapper select.form-control:focus {
    outline: none;
    border: 1.5px solid var(--primary-color);
    box-shadow: 0 0 0 3px rgba(27,94,94,0.15);
}
.registration-wrapper .form-control[aria-invalid="true"] { border-color: var(--danger); }
.registration-wrapper .help-block:not(:empty) { margin-top: 6px; }
.registration-wrapper .req { color: var(--danger); font-weight: 700; }
.form-section-title:focus { outline: none; }
.registration-wrapper [hidden] { display: none !important; }

/* The plan */
.plan-choice { margin: 0 0 20px; padding: 0; border: 0; }
.plan-option {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    min-height: 46px;
    padding: 10px 14px;
    margin-bottom: 8px;
    border: 1.5px solid var(--gray-border);
    border-radius: 10px;
    color: var(--text-dark);
    font-size: 14px;
    cursor: pointer;
}
.plan-option:has(input:checked) { border-color: var(--primary-color); background: var(--gray-light); }
.plan-option input[type="radio"] {
    position: static;
    opacity: 1;
    pointer-events: auto;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary-color);
}
.plan-option-name { font-weight: 600; }
.plan-option-price { margin-left: auto; color: var(--text-light); }

/* Password */
.password-box { position: relative; }
.registration-wrapper .password-box input.form-control { padding-right: 68px; }
.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    min-width: 54px;
    min-height: 36px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--primary-color);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.password-toggle:focus { background: none; }
.password-toggle:focus-visible { outline: 2px solid var(--primary-color); }

.division-retry {
    padding: 0;
    border: 0;
    background: none;
    color: var(--primary-color);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}
.division-retry:focus { background: none; }

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

.form-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
}

.required {
    color: var(--danger);
    font-weight: 700;
}

.form-text {
    font-size: 12px;
    color: #5f5f5f;
    margin-top: 6px;
    display: block;
}

/* Grid Layout */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

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

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

/* Password checklist */
.password-requirements {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}
.requirement-item { position: relative; padding-left: 20px; font-size: 12px; color: #5f5f5f; list-style: none; }
.requirement-item::before { content: '○'; position: absolute; left: 0; }
.requirement-item.met { color: var(--success); font-weight: 500; }
.requirement-item.met::before { content: '✓'; }

/* Buttons */
.button-group {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 12px;
}

.registration-wrapper .btn {
    padding: 12px 24px;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    text-transform: none;
    letter-spacing: normal;
}

.registration-wrapper .btn-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-light) 100%);
    color: var(--text-dark);
}

.registration-wrapper .btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.3);
}

.registration-wrapper .btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.registration-wrapper .btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.registration-wrapper .btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* Review Section */
.review-section {
    background: var(--gray-light);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.review-item {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-border);
}

.review-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.review-label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 13px;
    margin-bottom: 4px;
}

.review-value {
    color: #666;
    font-size: 14px;
}

/* Terms */
.terms-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 24px 0;
    padding: 16px;
    background: var(--gray-light);
    border-radius: 8px;
    border: 1px solid var(--gray-border);
}

.terms-container input[type="checkbox"] {
    position: static;
    opacity: 1;
    pointer-events: auto;
    margin-top: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.terms-container label {
    cursor: pointer;
    font-size: 14px;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.5;
}

.terms-container a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.terms-container a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Error Summary */
.error-summary {
    background: rgba(229, 57, 53, 0.08);
    border: 2px solid var(--danger);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    animation: slideDown 0.3s ease;
}

.error-summary-title {
    color: var(--danger);
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.error-summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.error-summary-list li {
    color: var(--danger);
    font-size: 13px;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.error-summary-list li:hover {
    color: var(--text-dark);
    padding-left: 4px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* The success page */
.registration-done { padding: 48px 24px; text-align: center; }
.registration-done h1 { margin: 12px 0; font-size: 1.8rem; font-weight: 700; color: var(--text-dark); }
.registration-done p { margin: 0 0 8px; color: var(--text-dark); }
.registration-done .btn { margin-top: 20px; }
.done-icon { font-size: 64px; color: var(--success); }

/* Review */
.review-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.review-heading h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--text-dark); }
.review-edit {
    min-height: 36px;
    padding: 0 8px;
    border: 0;
    background: none;
    color: var(--primary-color);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}
.review-edit:focus { background: none; }
.review-value { overflow-wrap: anywhere; }

/* Form Steps */
.form-step {
    display: none;
    animation: fadeIn 0.5s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .registration-body {
        padding: 24px;
    }

    .registration-header {
        padding: 30px 20px;
    }

    .registration-header h1 {
        font-size: 1.6rem;
    }

    .step-progress {
        padding: 16px 8px;
        gap: 4px;
    }

    .button-group {
        flex-direction: column;
    }

    .registration-wrapper .btn {
        width: 100%;
    }

}

@media (max-width: 576px) {
    .registration-wrapper {
        padding: 20px 12px;
    }

    .registration-header {
        padding: 24px 16px;
    }

    .registration-body {
        padding: 16px;
    }
}

/* Materialize draws its own radio on the span after the input. */
.plan-option input[type="radio"] + span { height: auto; padding-left: 0; font-size: inherit; line-height: inherit; color: inherit; }
.plan-option input[type="radio"] + span::before,
.plan-option input[type="radio"] + span::after { content: none; }
