/* Arbetsmiljö Portal - Global Styles */
/* Based on Swedish BIA (AFA) Design Principles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0078d4;
    --danger-color: #d13438;
    --warning-color: #ff8c00;
    --success-color: #107c10;
    --secondary-color: #605e5c;
    --background: #faf9f8;
    --surface: #ffffff;
    --text-primary: #201f1e;
    --text-secondary: #605e5c;
    --border-color: #edebe9;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: var(--surface);
    border-bottom: 2px solid var(--primary-color);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.user-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-worksite {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #106ebe;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #a4262c;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #d77c00;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #4d4b49;
}

.btn-back {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
}

.btn-back:hover {
    background: var(--primary-color);
    color: white;
}

.btn-logout {
    background: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
}

.btn-logout:hover {
    background: var(--danger-color);
    color: white;
}

.btn-large {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

/* Dashboard Grid */
.welcome-section {
    background: var(--surface);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.welcome-section h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--surface);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Info Section */
.info-section {
    background: var(--surface);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.info-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.info-section ul {
    list-style-position: inside;
    color: var(--text-secondary);
}

.info-section ul li {
    margin-bottom: 0.5rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-success {
    background: #dff6dd;
    border-color: var(--success-color);
    color: #0e5a0e;
}

.alert-error {
    background: #fde7e9;
    border-color: var(--danger-color);
    color: #a4262c;
}

.alert-warning {
    background: #fff4ce;
    border-color: var(--warning-color);
    color: #8a5700;
}

.alert-info {
    background: #e1f5fe;
    border-color: var(--primary-color);
    color: #014361;
}

/* Forms */
.form-container {
    background: var(--surface);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.report-form {
    max-width: 800px;
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

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

.form-section h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.1);
}

.form-group textarea {
    resize: vertical;
}

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

.form-info {
    background: #f3f2f1;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.form-info ul {
    list-style: none;
    margin-top: 0.5rem;
}

.form-info li {
    padding: 0.25rem 0;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Documents */
.page-header {
    margin-bottom: 2rem;
}

.page-header h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.document-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
}

.doc-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.document-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.doc-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* Info Boxes */
.important-notice {
    background: #fff4ce;
    border-left: 4px solid var(--warning-color);
    padding: 1.5rem;
    border-radius: 4px;
    margin-top: 2rem;
}

.important-notice h3 {
    color: var(--warning-color);
    margin-bottom: 1rem;
}

.important-notice ul {
    list-style-position: inside;
}

.important-notice li {
    margin-bottom: 0.5rem;
}

.info-box {
    background: #e1f5fe;
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.info-box h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.info-box h4 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.info-box ul {
    list-style-position: inside;
    margin-top: 0.5rem;
}

.help-section {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
    box-shadow: var(--shadow);
}

.help-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0078d4 0%, #106ebe 100%);
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 2rem;
}

.login-box {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.login-header {
    background: var(--primary-color);
    color: white;
    padding: 2rem;
    text-align: center;
}

.login-header h1 {
    color: white;
    margin-bottom: 0.5rem;
}

.login-content {
    padding: 2rem;
}

.login-description {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.feature-list {
    list-style: none;
    margin-bottom: 2rem;
}

.feature-list li {
    padding: 0.5rem 0;
    color: var(--text-primary);
}

.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.btn-login:hover {
    background: #106ebe;
}

.login-footer {
    background: #f3f2f1;
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Footer */
footer {
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-top: 3rem;
    text-align: center;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .user-info {
        flex-direction: column;
        text-align: center;
    }

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

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

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

    .btn {
        width: 100%;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
