*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f5f7fb;
    color: #1a1a1a;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.header h1 {
    margin: 0;
    font-size: 1.75rem;
    color: #2a3c6a;
}

.language-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #eef1fb;
    padding: 0.4rem 0.6rem;
    border-radius: 0.6rem;
}

.language-switch a {
    text-decoration: none;
    color: #2a3c6a;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 0.45rem;
}

.language-switch a.active {
    background-color: #2a3c6a;
    color: #ffffff;
}

.language-switch a:hover {
    opacity: 0.85;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-actions form {
    margin: 0;
}

.admin-link {
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    background-color: #2a3c6a;
    color: #ffffff;
    border-radius: 0.5rem;
    font-weight: 600;
}

.admin-link:hover {
    background-color: #1f2d4a;
}

.alert {
    padding: 1rem 1.2rem;
    border-radius: 0.6rem;
    margin-bottom: 1.5rem;
}

.alert ul {
    margin: 0.5rem 0 0;
    padding-left: 1.2rem;
}

.alert-error {
    background-color: #ffe6e6;
    border: 1px solid #ff9a9a;
    color: #a51111;
}

.alert-success {
    background-color: #e6fff0;
    border: 1px solid #8fe0b5;
    color: #1f7a4d;
}

.alert-info {
    background-color: #e8f1ff;
    border: 1px solid #9cb9ff;
    color: #274487;
}

.form {
    background-color: #ffffff;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 12px 30px rgba(42, 60, 106, 0.08);
}

.form-section + .form-section {
    margin-top: 2.5rem;
    border-top: 1px solid #eef1f7;
    padding-top: 2.5rem;
}

.form-section h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    color: #2a3c6a;
}

.grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    font-size: 0.95rem;
}

.field-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.field span {
    font-weight: 600;
    color: #2f3a59;
}

.field input,
.field textarea {
    padding: 0.7rem 0.8rem;
    border: 1px solid #ced5eb;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field textarea:focus {
    border-color: #4a63d8;
    box-shadow: 0 0 0 3px rgba(74, 99, 216, 0.15);
    outline: none;
}

.field-textarea textarea {
    resize: vertical;
}

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

.repeatable-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.repeatable-item {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.repeatable-two-columns input {
    flex: 1;
}

.repeatable-item input[type="file"] {
    flex: 1;
    min-width: 0;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: none;
    background-color: #ff5a5f;
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, opacity 0.2s ease;
    flex-shrink: 0;
}

.icon-button:hover {
    background-color: #e0484d;
}

.icon-button:active {
    transform: translateY(1px) scale(0.95);
}

.remove-button,
.logout-button {
    align-self: flex-start;
    padding: 0.55rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, opacity 0.2s ease;
}

.remove-button {
    background-color: #f0f2f9;
    color: #2f3a59;
}

.remove-button:hover {
    background-color: #e1e6f5;
}

.logout-button {
    background-color: #f44336;
    color: #ffffff;
}

.logout-button:hover {
    background-color: #d63428;
}

.logout-button:active,
.remove-button:active {
    transform: translateY(1px);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.form-actions {
    margin-top: 2.5rem;
    display: flex;
    justify-content: flex-end;
}

.submit-button {
    padding: 0.75rem 2.5rem;
    background-color: #2a3c6a;
    color: #ffffff;
    border: none;
    border-radius: 0.6rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.submit-button:hover {
    background-color: #1f2d4a;
}

.submit-button:active {
    transform: translateY(1px);
}

.records {
    display: grid;
    gap: 1.5rem;
}

.record-card {
    background-color: #ffffff;
    border-radius: 0.9rem;
    padding: 1.5rem;
    box-shadow: 0 10px 24px rgba(42, 60, 106, 0.06);
    border: 1px solid #e4e9f6;
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    border-bottom: 1px solid #eef1f7;
    padding-bottom: 1rem;
}

.record-header h2 {
    margin: 0;
    font-size: 1.1rem;
    color: #2a3c6a;
}

.record-header p {
    margin: 0.3rem 0 0;
    font-weight: 500;
    color: #3a4770;
}

.record-header time {
    font-size: 0.9rem;
    color: #637196;
    white-space: nowrap;
}

.record-body {
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.record-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.record-grid dt {
    font-weight: 600;
    color: #2f3a59;
}

.record-grid dd {
    margin: 0.2rem 0 0;
    color: #4f5878;
}

.record-section h3 {
    margin: 0 0 0.6rem;
    font-size: 1rem;
    color: #2a3c6a;
}

.record-section ul {
    margin: 0;
    padding-left: 1.2rem;
    color: #4f5878;
}

.record-section p {
    margin: 0;
    color: #4f5878;
}

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

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

    .admin-link {
        width: 100%;
        text-align: center;
    }

    .language-switch {
        align-self: stretch;
        justify-content: space-between;
    }

    .header-actions {
        flex-direction: column;
        align-items: stretch;
    }

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


