/* RESET & BASE */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #f4f6f8;
    color: #33475b;
    font-size: 14px;
    height: 100vh;
    overflow: hidden;
    /* We'll use per-view scrolling */
}

/* UTILS */
.hidden {
    display: none !important;
}

.hidden-content {
    display: none;
}

.highlight-text {
    color: #ff7a59;
    font-weight: 700;
}

/* VIEW CONTAINER */
.view-container {
    height: 100vh;
    width: 100vw;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    background: #eaf0f6;
    transition: opacity 0.3s ease;
}

/* Page 1 (Login) & Page 2 (Welcome) Centered */
#view-login,
#view-welcome {
    justify-content: center;
    align-items: center;
}

/* Page 3 (Form) Scrollable */
.scroll-view {
    display: block;
    overflow-y: auto;
    padding: 40px 20px;
}

/* Page 4 (Associations) - Specific flex layout */
/* Page 4 (Associations) - Standard View Container */
/* #view-associations inherits .view-container (flex) and .scroll-view (block) */

/* CARDS */

/* CARDS */
.central-card {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.central-card h2 {
    margin-bottom: 8px;
    color: #2e475d;
}

.subtitle {
    color: #516f90;
    margin-bottom: 24px;
    font-size: 14px;
}

.section-card {
    background: white;
    border: 1px solid #dfe3eb;
    border-radius: 6px;
    margin-bottom: 25px;
    /* Increased margin between cards */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
    /* Ensure header background stays within radius */
}

.section-content {
    padding: 24px 30px 30px 30px;
    /* Better internal padding */
    animation: fadeIn 0.3s ease;
}

.section-header {
    background: #f8f9fb;
    padding: 16px 24px;
    /* More vertical breathing room in header */
    border-bottom: 1px solid #eaf0f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title-center {
    justify-content: center;
    border-bottom: 2px solid #ff7a59;
}

.section-title-center h2 {
    font-size: 16px;
    /* Slightly smaller for 'cleaner' look */
    font-weight: 600;
    /* Medium-bold instead of heavy */
    margin: 0;
    color: #33475b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.app-header {
    max-width: 800px;
    margin: 0 auto 30px auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 15px 24px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.main-content {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

/* ACCORDIONS */
.accordion .toggle-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.accordion .toggle-header:hover {
    color: #ff7a59;
}

.accordion .section-content {
    border-top: 1px solid #f0f4f8;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* FORM ELEMENTS */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.input-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    margin-bottom: 0;
    /* Handled by grid gap now */
    width: 100%;
}

label {
    font-size: 11px;
    /* Smaller labels */
    font-weight: 500;
    /* Regular bold */
    margin-bottom: 8px;
    /* More space between label and box */
    color: #7c98b6;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

input,
select,
textarea {
    padding: 10px 12px;
    border: 1px solid #cbd6e2;
    border-radius: 4px;
    font-size: 13px;
    width: 100%;
    transition: border 0.2s;
    background-color: white;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #ff7a59;
    box-shadow: 0 0 0 3px rgba(255, 122, 89, 0.15);
}

textarea {
    min-height: 80px;
    resize: vertical;
}

.locked-input {
    background-color: #f5f8fa;
    color: #7c98b6;
    cursor: not-allowed;
}

.helper-text {
    font-size: 11px;
    color: #00a4bd;
    margin-top: 4px;
    min-height: 14px;
}

/* BUTTONS */
.primary-btn,
.submit-btn {
    background-color: #ff7a59;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    width: 100%;
    margin-top: 10px;
    transition: background 0.2s;
}

.primary-btn:hover,
.submit-btn:hover {
    background-color: #d95e3c;
}

.text-btn {
    background: none;
    border: none;
    color: #516f90;
    cursor: pointer;
    text-decoration: underline;
    font-weight: 700;
    font-size: 16px;
}

.secondary-btn {
    background-color: #eaf0f6;
    color: #516f90;
    border: 1px solid #cbd6e2;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background-color: #cbd6e2;
    color: #2e475d;
}

.form-actions {
    max-width: 800px;
    margin: 30px auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* AUTOCOMPLETE */
.autocomplete-container {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #cbd6e2;
    border-top: none;
    border-radius: 0 0 4px 4px;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none;
}

.autocomplete-list div {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #f0f2f5;
}

.autocomplete-list div:last-child {
    border-bottom: none;
}

.autocomplete-list div:hover {
    background-color: #f5f8fa;
    color: #ff7a59;
}

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

    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
    }

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

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

    .secondary-btn,
    .submit-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 24px;
    }

    .section-header h4 {
        font-size: 14px;
    }

    .input-group label {
        font-size: 12px;
    }
}

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

    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
    }

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

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

    .secondary-btn,
    .submit-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 24px;
    }

    .section-header h4 {
        font-size: 14px;
    }

    .input-group label {
        font-size: 12px;
    }
}

.message {
    margin-top: 12px;
    font-size: 13px;
    min-height: 20px;
}

.message.error {
    color: #f2545b;
}

.message.success {
    color: #00bda5;
}

.spacer {
    height: 60px;
}

/* ASSOCIATION MANAGEMENT (PAGE 4) */
.association-list {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.association-item {
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: transform 0.1s;
}

.association-item:hover {
    transform: translateX(3px);
    border-color: #94a3b8;
}

.association-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.association-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
}

.association-meta {
    font-size: 11px;
    color: #64748b;
    font-family: monospace;
}

.remove-assoc-btn {
    background: #fee2e2;
    color: #ef4444;
    border: 1px solid #fecaca;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.remove-assoc-btn:hover {
    background: #ef4444;
    color: white;
    border-color: #dc2626;
}

.empty-msg {
    color: #94a3b8;
    font-style: italic;
    font-size: 13px;
    text-align: center;
    margin: 10px 0;
}

.primary-btn.secondary-style {
    background-color: #33475b;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.primary-btn.secondary-style:hover {
    background-color: #1e293b;
}

.primary-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-grow: 1;
}

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

.search-entry label {
    color: #475569;
    font-weight: 600;
}

.validation-status {
    font-size: 12px;
    margin-top: 5px;
    min-height: 18px;
    transition: all 0.2s;
}

.validation-status.loading {
    color: #33475b;
    font-style: italic;
}

.validation-status.success {
    color: #00bda5;
    font-weight: 600;
}

.validation-status.error {
    color: #f2545b;
}

/* Error Banner for Associations */
.error-banner {
    background-color: #fee2e2;
    color: #b91c1c;
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-banner.hidden {
    display: none;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}