/**
 * SALEAF Application Portal - Styles
 * Matching saleaf.co.za design (green theme, clean, professional)
 */

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.8;
    color: #333333;
    background-color: #f7f7f7;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
}

.main-content {
    background: #ffffff;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    text-align: center;
    padding: 30px 0;
}

.header h1 {
    font-family: "Abril Fatface", Georgia, serif;
    font-size: 32px;
    color: #14783c;
    margin-bottom: 10px;
    letter-spacing: 1.5px;
}

.header .subtitle {
    font-size: 16px;
    color: #666;
    margin-top: 5px;
}

.admin-nav {
    margin-top: 15px;
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.admin-nav a {
    color: #14783c;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 3px;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: #f0f0f0;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h2 {
    font-size: 20px;
    color: #14783c;
    margin-bottom: 15px;
    font-weight: 600;
}

h3 {
    font-size: 18px;
    color: #14783c;
    margin: 20px 0 10px;
    font-weight: 600;
}

h4 {
    font-size: 17px;
    color: #333;
    margin: 15px 0 8px;
}

p {
    margin-bottom: 15px;
}

.lead {
    font-size: 18px;
    font-weight: 500;
    color: #555;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.btn-primary {
    background-color: #14783c;
    color: #ffffff;
    border-color: #ffffff;
}

.btn-primary:hover {
    background-color: #31776c;
}

.btn-secondary {
    background-color: #666;
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: #555;
}

.btn-outline {
    background-color: transparent;
    color: #14783c;
    border-color: #14783c;
}

.btn-outline:hover {
    background-color: #14783c;
    color: #ffffff;
}

.btn-large {
    padding: 15px 50px;
    font-size: 16px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    text-transform: none;
    letter-spacing: 0;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

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

label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.required {
    color: #d9534f;
}

.form-control,
.form-control-file {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 3px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #14783c;
}

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

small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.radio-group,
.checkbox-group {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

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

.radio-label input[type="radio"],
.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

/* ============================================
   FORM ACTIONS
   ============================================ */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* ============================================
   ALERTS & MESSAGES
   ============================================ */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 3px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-container {
    margin: 20px 0 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #14783c;
    transition: width 0.3s;
}

.progress-text {
    text-align: center;
    margin-top: 8px;
    font-size: 13px;
    color: #666;
}

/* ============================================
   STEP NAVIGATION
   ============================================ */
.step-nav {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.step-indicator {
    display: block;
    text-align: center;
    padding: 10px 5px;
    border-radius: 5px;
    background: #f0f0f0;
    transition: all 0.2s;
    text-decoration: none;
    color: #333;
    cursor: pointer;
}

.step-indicator:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.step-indicator.active {
    background: #14783c;
    color: #ffffff;
}

.step-indicator.active:hover {
    background: #14783c;
    transform: none;
}

.step-indicator.completed {
    background: #d4edda;
}

.step-indicator.completed:hover {
    background: #c3e6cb;
}

.step-number {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 5px;
}

.step-title {
    font-size: 11px;
    line-height: 1.2;
}

/* ============================================
   CARDS
   ============================================ */
.action-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

.card {
    background: #ffffff;
    padding: 25px;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.card h3 {
    color: #14783c;
    margin-top: 0;
}

/* ============================================
   APPLICATION FORM (Landing Page)
   ============================================ */
.application-form {
    max-width: 600px;
    margin: 30px auto;
    padding: 40px;
    background: #ffffff;
    border-radius: 8px;
    border: 2px solid #14783c;
    box-shadow: 0 4px 15px rgba(20, 120, 60, 0.1);
}

.application-form form {
    margin-bottom: 30px;
}

.application-form .form-control {
    font-size: 16px;
    padding: 12px;
}

.info-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    border-left: 4px solid #14783c;
}

.info-box h4 {
    margin-top: 0;
    color: #14783c;
}

.info-box ol {
    margin: 15px 0;
    padding-left: 20px;
}

.info-box li {
    margin-bottom: 8px;
}

/* Wizard form container */
.wizard-form {
    width: 100%;
    overflow: visible;
}

.info-box p {
    margin: 15px 0 0;
    font-size: 13px;
}

/* ============================================
   FEATURES & INFO SECTIONS
   ============================================ */
.features {
    display: grid;
    gap: 10px;
    margin: 20px 0;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
}

.feature .icon {
    color: #14783c;
    font-weight: bold;
    font-size: 18px;
}

.info-section,
.welcome-section {
    margin: 30px 0;
}

.info-section ul,
.welcome-section ul {
    margin-left: 20px;
    margin-top: 10px;
}

.info-section li,
.welcome-section li {
    margin-bottom: 8px;
}

/* ============================================
   ADMIN DASHBOARD
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #14783c 0%, #31776c 100%);
    color: #ffffff;
    padding: 25px;
    border-radius: 5px;
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

/* ============================================
   FILTERS
   ============================================ */
.filters-section {
    margin-bottom: 20px;
}

.filters-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
}

/* ============================================
   TABLES
   ============================================ */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

table thead {
    background: #f8f9fa;
}

table th,
table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

table th {
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

table tbody tr:hover {
    background: #f8f9fa;
}

.text-center {
    text-align: center !important;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

/* ============================================
   APPLICATION VIEW
   ============================================ */
.section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.section:last-child {
    border-bottom: none;
}

.data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.data-item {
    padding: 10px 0;
}

.data-item.full-width {
    grid-column: 1 / -1;
}

.data-item strong {
    display: block;
    color: #666;
    font-size: 12px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

/* ============================================
   FILE UPLOADS
   ============================================ */
.uploaded-files {
    margin: 20px 0;
}

.file-list {
    display: grid;
    gap: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
}

.file-icon {
    font-size: 24px;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    margin-bottom: 3px;
}

.file-meta {
    font-size: 12px;
    color: #666;
}

/* ============================================
   THANK YOU PAGE & SAVE EXIT PAGE
   ============================================ */
.thank-you-section,
.save-exit-section {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #28a745;
    color: #ffffff;
    font-size: 50px;
    line-height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px;
}

/* Save & Exit Page Specific */
.save-exit-section .info-box {
    text-align: left;
}

.progress-summary {
    margin: 30px auto;
    max-width: 400px;
}

.resume-option {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.resume-option:last-child {
    border-bottom: none;
}

.resume-link-box {
    margin: 15px 0;
}

.link-copy-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
}

.link-copy-box input {
    font-family: monospace;
    font-size: 12px;
    background: #ffffff;
}

.copy-link-section {
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}

.info-box {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 5px;
    margin: 30px 0;
    text-align: left;
}

.next-steps {
    list-style: none;
    counter-reset: steps;
}

.next-steps li {
    counter-increment: steps;
    position: relative;
    padding-left: 50px;
    margin-bottom: 25px;
}

.next-steps li::before {
    content: counter(steps);
    position: absolute;
    left: 0;
    top: 0;
    width: 35px;
    height: 35px;
    background: #14783c;
    color: #ffffff;
    border-radius: 50%;
    text-align: center;
    line-height: 35px;
    font-weight: bold;
}

.next-steps li strong {
    display: block;
    margin-bottom: 5px;
}

.next-steps li p {
    margin: 0;
    color: #666;
    font-size: 13px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: #666;
    font-size: 13px;
}

.footer a {
    color: #14783c;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .main-content {
        padding: 20px;
    }

    .header h1 {
        font-size: 24px;
    }

    .action-cards,
    .form-row,
    .data-grid {
        grid-template-columns: 1fr;
    }

    .step-nav {
        grid-template-columns: repeat(4, 1fr);
    }

    .step-title {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .filters-form {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* ============================================
   STEP CONTENT & DECLARATION (Step 10)
   ============================================ */
.step-content {
    width: 100%;
    overflow: visible;
}

.declaration-section {
    margin-bottom: 30px;
}

.declaration-text {
    margin: 30px 0;
    padding: 25px;
    background: #f9f9f9;
    border-radius: 5px;
    border-left: 4px solid #14783c;
}

.declaration-text h3 {
    color: #14783c;
    margin-top: 0;
    margin-bottom: 15px;
}

.declaration-content {
    line-height: 1.8;
}

.declaration-content ol {
    margin: 15px 0;
    padding-left: 25px;
}

.declaration-content ol li {
    margin-bottom: 12px;
    padding-left: 5px;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    body {
        background: #ffffff;
    }

    .no-print {
        display: none !important;
    }

    .main-content {
        box-shadow: none;
    }

    .section {
        page-break-inside: avoid;
    }
}
