/* --- VARIABLES --- */
:root {
    --primary: #10b981;       /* Agri Green */
    --bg-slate: #f8fafc;      /* Background */
    --surface: #ffffff;       /* Card White */
    --text-main: #0f172a;     /* Dark Black */
    --text-muted: #64748b;    /* Label Gray */
    --border: #e2e8f0;
    --radius: 20px;
}

body {
    background-color: var(--bg-slate);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
}

/* --- WRAPPER --- */
.activity-screen {
    max-width: 700px;
    margin: 60px auto;
    padding: 0 20px;
}

/* --- CARD DESIGN --- */
.activity-card {
    background: var(--surface);
    border-radius: var(--radius);
    /* Premium double-layer shadow */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    padding: 40px;
    border: 1px solid white;
}

/* --- HEADER --- */
.activity-header {
    text-align: center;
    margin-bottom: 35px;
}

.header-icon {
    width: 64px;
    height: 64px;
    background: #eff6ff; /* Light Blue tint */
    color: #2563eb;      /* Royal Blue Icon */
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 15px;
}

.activity-title h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.activity-subtitle {
    color: var(--text-muted);
    margin-top: 8px;
    font-size: 0.95rem;
}

/* --- FORM INPUTS --- */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155; /* Slate 700 */
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.modern-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    background-color: #f1f5f9; /* Light Gray Field */
    border: 2px solid transparent;
    border-radius: 12px;
    color: #0f172a;
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-family: inherit;
}

/* Focus State: White bg + Green Border */
.modern-input:focus {
    outline: none;
    background-color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

textarea.modern-input {
    resize: vertical;
    min-height: 100px;
}

/* --- GRID LAYOUT --- */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* --- BUTTONS --- */
.form-submit {
    margin-top: 35px;
}

.btn-submit {
    width: 100%;
    padding: 16px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Dark Midnight Style (Matches Harvests) */
    background: #0f172a;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.2);
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.2);
    background-color: #1e293b;
}

/* Back Link */
.back-wrapper {
    text-align: center;
    margin-top: 25px;
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 50px;
    transition: all 0.2s;
}

.back-link:hover {
    background: white;
    color: var(--text-main);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* --- ERROR BOX --- */
.error-banner {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #991b1b;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 25px;
}
.error-banner h3 { margin: 0 0 5px 0; font-size: 1rem; }
.error-banner ul { margin: 0; padding-left: 20px; }

/* --- RESPONSIVE --- */
@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .activity-card { padding: 25px; }
}

/* --- VALIDATION ERROR STYLES --- */

/* 1. Turns the input border Red */
.input-error {
    border-color: #dc2626 !important; /* Red */
    background-color: #fef2f2 !important; /* Light Pink */
}

/* 2. Red Glow on focus */
.input-error:focus {
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15) !important;
}

/* 3. Tiny text message under the input */
.inline-err-msg {
    color: #dc2626;
    font-size: 0.85rem;
    margin-top: 6px;
    display: block;
    font-weight: 600;
    animation: slideDown 0.2s ease-out;
}

/* Animation for the error text */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 4. Fix for Rails wrapping inputs in div.field_with_errors */
.field_with_errors {
    display: contents; /* Prevents Rails div from breaking your grid layout */
}