/* =========================================
   KUPONGPORTALEN
   Grundläggande design
   ========================================= */

:root {
    --primary: #1F7A8C;
    --primary-dark: #17616f;
    --secondary: #AD3F8B;

    --success: #198754;
    --danger: #dc3545;
    --warning: #f0ad4e;

    --background: #f5f7f8;
    --surface: #ffffff;
    --border: #dee2e6;

    --text: #263238;
    --muted: #6c757d;

    --radius: 12px;
    --shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}


/* =========================================
   GRUND
   ========================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text);
}


/* =========================================
   LAYOUT
   ========================================= */

.portal-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.portal-main {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 40px;
    flex: 1;
}

.portal-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}


/* =========================================
   HEADER
   ========================================= */

.portal-header {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow);
}

.portal-header-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 16px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.portal-logo {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.portal-user {
    text-align: right;
    font-size: 14px;
    line-height: 1.4;
}

.portal-user strong {
    display: block;
}


/* =========================================
   RUBRIKER
   ========================================= */

h1,
h2,
h3 {
    margin-top: 0;
}

.page-title {
    margin-bottom: 24px;
}

.page-title h1 {
    margin-bottom: 6px;
    font-size: 28px;
}

.page-title p {
    margin: 0;
    color: var(--muted);
}


/* =========================================
   KORT
   ========================================= */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}


/* =========================================
   KNAPPAR
   ========================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 46px;
    padding: 10px 18px;

    border: 0;
    border-radius: 9px;

    font-size: 16px;
    font-weight: 600;

    text-decoration: none;
    cursor: pointer;

    transition:
        background-color 0.15s ease,
        transform 0.05s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #e9ecef;
    color: var(--text);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-warning {
    background: var(--warning);
    color: #fff;
}


/* =========================================
   FORMULÄR
   ========================================= */

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
}

.form-control,
.form-select {
    width: 100%;
    min-height: 46px;

    padding: 10px 12px;

    border: 1px solid #cfd4da;
    border-radius: 8px;

    background: #fff;
    color: var(--text);

    font-size: 16px;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 122, 140, 0.15);
}


/* =========================================
   ALERTS
   ========================================= */

.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d1e7dd;
    color: #0f5132;
}

.alert-danger {
    background: #f8d7da;
    color: #842029;
}

.alert-warning {
    background: #fff3cd;
    color: #664d03;
}


/* =========================================
   FOOTER
   ========================================= */

.portal-footer {
    background: #fff;
    border-top: 1px solid var(--border);
    color: var(--muted);
    padding: 15px 16px;
    text-align: center;
    font-size: 13px;
}


/* =========================================
   MOBIL
   ========================================= */

@media (max-width: 600px) {

    .portal-header-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 12px 16px;
    }

    .portal-logo {
        font-size: 19px;
        white-space: nowrap;
    }

    .portal-user {
        text-align: right;
        font-size: 13px;
        line-height: 1.3;
        padding: 5px 7px;
    }

    .portal-user strong {
        font-size: 13px;
    }

    .portal-user span {
        font-size: 12px;
    }

    .portal-main {
        padding: 20px 16px 30px;
    }

    .page-title h1 {
        font-size: 24px;
    }

    .card {
        padding: 16px;
    }

    .btn {
        width: 100%;
    }
}

/* =========================================
   STARTMENY
   ========================================= */

.portal-menu {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.menu-card {
    display: flex;
    align-items: center;
    gap: 18px;

    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);

    padding: 24px;

    color: var(--text);
    text-decoration: none;

    box-shadow: var(--shadow);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease;
}

.menu-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);

    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.10);
}

.menu-icon {
    width: 58px;
    height: 58px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(31, 122, 140, 0.10);
    border-radius: 12px;

    font-size: 30px;
}

.menu-content h2 {
    margin: 0 0 5px;
    font-size: 20px;
}

.menu-content p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}


/* =========================================
   STARTMENY MOBIL
   ========================================= */

@media (max-width: 700px) {

    .portal-menu {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .menu-card {
        padding: 18px;
    }

}

.phone-preview {
    margin-top: 8px;
    margin-bottom: 18px;
    font-weight: 600;
}

/* =========================================
   AKTIV MEDARBETARE I HEADER
   ========================================= */

.portal-user-button {
    border: 0;
    background: transparent;
    color: #fff;
    padding: 6px 10px;
    margin: 0;

    font-family: inherit;
    font-size: 14px;

    text-align: right;
    cursor: pointer;

    border-radius: 8px;

    transition: background-color 0.15s ease;
}

.portal-user-button:hover {
    background: rgba(255, 255, 255, 0.12);
}

.portal-user-button:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}


/* =========================================
   MEDARBETAR-MODAL
   ========================================= */

.modal-overlay {
    position: fixed;
    inset: 0;

    z-index: 1000;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.55);
}

.modal-overlay.is-open {
    display: flex;
}

.employee-modal {
    width: 100%;
    max-width: 480px;

    background: #fff;
    border-radius: 16px;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);

    overflow: hidden;

    animation: modalOpen 0.15s ease-out;
}

@keyframes modalOpen {

    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* =========================================
   MODAL HEADER
   ========================================= */

.employee-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    padding: 20px;

    background: var(--primary);
    color: #fff;
}

.employee-modal-header h2 {
    margin: 0 0 4px;
    font-size: 22px;
}

.employee-modal-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

.modal-close {
    flex-shrink: 0;

    width: 36px;
    height: 36px;

    border: 0;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.12);
    color: #fff;

    font-size: 26px;
    line-height: 1;

    cursor: pointer;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.22);
}


/* =========================================
   MODAL BODY
   ========================================= */

.employee-modal-body {
    padding: 20px;
}

.modal-question {
    margin: 0 0 14px;
    font-weight: 600;
}


/* =========================================
   MEDARBETARLISTA
   ========================================= */

.employee-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.employee-list form {
    margin: 0;
}

.employee-option {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 54px;

    padding: 12px 16px;

    border: 2px solid var(--border);
    border-radius: 10px;

    background: #fff;
    color: var(--text);

    font-size: 16px;
    font-weight: 600;

    text-align: left;
    cursor: pointer;

    transition:
        border-color 0.15s ease,
        background-color 0.15s ease;
}

.employee-option:hover {
    border-color: var(--primary);
    background: rgba(31, 122, 140, 0.05);
}

.employee-option.active {
    border-color: var(--primary);
    background: rgba(31, 122, 140, 0.10);
}

.employee-option-check {
    color: var(--primary);
    font-size: 20px;
}


/* =========================================
   MODAL FOOTER
   ========================================= */

.employee-modal-footer {
    display: flex;
    justify-content: flex-end;

    padding: 16px 20px;

    border-top: 1px solid var(--border);
}


/* =========================================
   MOBIL
   ========================================= */

@media (max-width: 600px) {

    .modal-overlay {
        padding: 12px;
    }

    .employee-modal {
        border-radius: 14px;
    }

    .employee-modal-header {
        padding: 18px;
    }

    .employee-modal-body {
        padding: 18px;
    }

    .employee-modal-footer {
        padding: 14px 18px;
    }

}

/* =========================================
   LOGIN
   ========================================= */

.login-page {
    min-height: 100vh;

    background:
        linear-gradient(
            135deg,
            #1F7A8C 0%,
            #17616f 45%,
            #AD3F8B 100%
        );

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;
}


.login-wrapper {
    width: 100%;
    max-width: 430px;
}


.login-card {
    background: #fff;

    border-radius: 18px;

    padding: 36px;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.20);
}


/* =========================================
   LOGIN LOGO
   ========================================= */

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 10px;

    margin-bottom: 28px;
}


.login-logo-mark {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: var(--primary);

    color: #fff;

    font-size: 15px;
    font-weight: 700;
}


.login-logo-text {
    font-size: 20px;
    font-weight: 700;

    color: var(--text);
}


/* =========================================
   LOGIN RUBRIK
   ========================================= */

.login-heading {
    text-align: center;

    margin-bottom: 28px;
}


.login-heading h1 {
    margin: 0 0 7px;

    font-size: 28px;
}


.login-heading p {
    margin: 0;

    color: var(--muted);

    font-size: 15px;
}


/* =========================================
   LOGIN FORM
   ========================================= */

.login-form .form-group {
    margin-bottom: 20px;
}


.login-form .form-control {
    min-height: 50px;
}


.login-button {
    width: 100%;

    min-height: 50px;

    margin-top: 4px;

    font-size: 17px;
}


/* =========================================
   LÖSENORD
   ========================================= */

.password-wrapper {
    position: relative;
}


.password-wrapper .form-control {
    padding-right: 52px;
}


.password-toggle {
    position: absolute;

    top: 50%;
    right: 8px;

    transform: translateY(-50%);

    width: 40px;
    height: 40px;

    border: 0;
    border-radius: 8px;

    background: transparent;

    cursor: pointer;

    font-size: 18px;
}


.password-toggle:hover {
    background: #f1f3f5;
}


/* =========================================
   LOGIN FELMEDDELANDE
   ========================================= */

.login-alert {
    margin-bottom: 20px;

    text-align: center;
}


/* =========================================
   LOGIN FOOTER
   ========================================= */

.login-footer {
    margin-top: 28px;

    padding-top: 18px;

    border-top: 1px solid var(--border);

    text-align: center;

    color: var(--muted);

    font-size: 13px;
}


/* =========================================
   LOGIN MOBIL
   ========================================= */

@media (max-width: 500px) {

    .login-page {
        padding: 12px;
    }

    .login-card {
        padding: 28px 20px;

        border-radius: 14px;
    }

    .login-heading h1 {
        font-size: 25px;
    }

}

/* =========================================
   MOBIL HEADER – SLUTLIG ÖVERSKRIFT
   ========================================= */

@media (max-width: 600px) {

    .portal-header-inner {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;

        width: 100% !important;

        padding: 12px 16px !important;

        gap: 10px !important;
    }

    .portal-logo {
        font-size: 19px !important;
        white-space: nowrap !important;
        flex-shrink: 1 !important;
    }

    .portal-user-button {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-end !important;

        width: auto !important;
        margin-left: auto !important;

        padding: 5px 7px !important;

        text-align: right !important;
        white-space: nowrap !important;

        flex-shrink: 0 !important;
    }

    .portal-user-button strong {
        display: block !important;
        font-size: 13px !important;
        line-height: 1.3 !important;
    }

    .portal-user-button span {
        display: block !important;
        font-size: 12px !important;
        line-height: 1.3 !important;
    }

}