/* /login/public/css/gateway.css */

/*
|--------------------------------------------------------------------------
| Gateway UI layer
|--------------------------------------------------------------------------
|
| Shared presentation слой за login gateway-а.
|
| Използва се от:
| - institution chooser
| - module chooser
|
| Не author-ва:
| - Institution truth
| - Institution Type truth
| - Module truth
| - Access truth
|
*/

:root {
    --gateway-bg: #e7f4f8;
    --gateway-bg-strong: #c7e7f0;

    --gateway-panel: rgba(205, 233, 243, 0.74);
    --gateway-panel-soft: rgba(214, 239, 247, 0.78);

    --gateway-card-bg: rgba(224, 246, 251, 0.92);
    --gateway-card-bg-hover: rgba(216, 242, 249, 0.98);

    --gateway-text: #102a43;
    --gateway-muted: #4f7188;

    --gateway-border: rgba(13, 126, 184, 0.18);
    --gateway-border-strong: rgba(13, 126, 184, 0.42);

    --gateway-shadow: 0 18px 46px rgba(16, 42, 67, 0.13);
    --gateway-card-shadow: 0 8px 20px rgba(16, 42, 67, 0.07);
    --gateway-card-shadow-hover: 0 16px 32px rgba(16, 42, 67, 0.13);

    --gateway-primary: #0d7eb8;
    --gateway-primary-dark: #075f8e;
    --gateway-primary-soft: rgba(255, 255, 255, 0.42);

    --gateway-radius: 24px;
    --gateway-card-radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: var(--gateway-text);
    background:
        radial-gradient(circle at top left, rgba(13, 126, 184, 0.22), transparent 34rem),
        radial-gradient(circle at bottom right, rgba(13, 126, 184, 0.14), transparent 30rem),
        linear-gradient(135deg, var(--gateway-bg), var(--gateway-bg-strong));
}

a {
    color: inherit;
}

/*
|--------------------------------------------------------------------------
| Shell
|--------------------------------------------------------------------------
*/

.gateway-shell {
    width: 100%;
    min-height: 100vh;
    padding: 40px 20px;
}

.gateway-container {
    width: min(920px, 100%);
    margin: 0 auto;
}

/*
|--------------------------------------------------------------------------
| Top bar
|--------------------------------------------------------------------------
*/

.gateway-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.gateway-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.gateway-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gateway-primary), var(--gateway-primary-dark));
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 22px rgba(13, 126, 184, 0.22);
    flex: 0 0 auto;
}

.gateway-brand-text {
    min-width: 0;
}

.gateway-brand-title {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
}

.gateway-brand-subtitle {
    margin-top: 2px;
    font-size: 13px;
    color: var(--gateway-muted);
}

.gateway-user-area {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--gateway-muted);
}

.gateway-user-name {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gateway-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--gateway-primary-dark);
    background: rgba(255, 255, 255, 0.42);
    border: 1px solid var(--gateway-border);
    font-weight: 700;
    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease;
}

.gateway-logout:hover {
    background: rgba(255, 255, 255, 0.68);
    border-color: var(--gateway-border-strong);
    box-shadow: 0 8px 18px rgba(16, 42, 67, 0.10);
}

/*
|--------------------------------------------------------------------------
| Main panel
|--------------------------------------------------------------------------
*/

.gateway-panel {
    background: var(--gateway-panel);
    border: 1px solid rgba(255, 255, 255, 0.46);
    border-radius: var(--gateway-radius);
    box-shadow: var(--gateway-shadow);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.gateway-panel-header {
    padding: 32px 34px 22px;
    border-bottom: 1px solid rgba(13, 126, 184, 0.14);
    background: rgba(213, 239, 247, 0.34);
}

.gateway-page-title {
    margin: 0;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.08;
    letter-spacing: -0.035em;
    font-weight: 850;
}

.gateway-page-subtitle {
    margin: 10px 0 0;
    color: var(--gateway-muted);
    font-size: 16px;
    line-height: 1.55;
}

.gateway-panel-body {
    padding: 28px 34px 34px;
    background: rgba(197, 231, 241, 0.22);
}

/*
|--------------------------------------------------------------------------
| Toolbar / search
|--------------------------------------------------------------------------
*/

.gateway-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 22px;
}

.gateway-search {
    width: 100%;
    min-height: 48px;
    border-radius: 16px;
    border: 1px solid var(--gateway-border);
    background: rgba(238, 250, 253, 0.92);
    color: var(--gateway-text);
    padding: 0 16px;
    font-size: 15px;
    outline: none;
    box-shadow: 0 4px 12px rgba(16, 42, 67, 0.04);
}

.gateway-search:focus {
    border-color: rgba(13, 126, 184, 0.55);
    box-shadow: 0 0 0 4px rgba(13, 126, 184, 0.12);
}

/*
|--------------------------------------------------------------------------
| Gateway cards
|--------------------------------------------------------------------------
*/

.gateway-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.gateway-card {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 140px;
    padding: 14px 18px;
    border-radius: var(--gateway-card-radius);
    background: var(--gateway-card-bg);
    border: 1px solid var(--gateway-border);
    text-decoration: none;
    box-shadow: var(--gateway-card-shadow);
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        border-color 0.16s ease,
        background 0.16s ease;
}

.gateway-card:hover {
    transform: translateY(-2px);
    background: var(--gateway-card-bg-hover);
    box-shadow: var(--gateway-card-shadow-hover);
    border-color: var(--gateway-border-strong);
}

.gateway-card.is-disabled {
    opacity: 0.62;
    cursor: not-allowed;
}

.gateway-card.is-disabled:hover {
    transform: none;
    box-shadow: var(--gateway-card-shadow);
    border-color: var(--gateway-border);
}

.gateway-card-visual {
    width: 108px;
    height: 108px;
    border-radius: 20px;
    flex: 0 0 auto;
    overflow: hidden;
    background: linear-gradient(135deg, #dff4fa, #bfe4f0);
    box-shadow:
        inset 0 0 0 1px rgba(13, 126, 184, 0.10),
        0 8px 18px rgba(16, 42, 67, 0.10);
}

.gateway-card-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.gateway-card-mark {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #dff4fa, #bfe4f0);
    color: var(--gateway-primary-dark);
    font-size: 34px;
    font-weight: 800;
    text-transform: uppercase;
}

.gateway-card-content {
    min-width: 0;
    flex: 1;
}

.gateway-card-title {
    color: var(--gateway-text);
    font-size: 22px;
    font-weight: 850;
    line-height: 1.22;
    word-break: break-word;
}

.gateway-card-type,
.gateway-card-badge {
    display: inline-flex;
    margin-top: 8px;
    max-width: 100%;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.52);
    color: var(--gateway-primary-dark);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.25;
    border: 1px solid rgba(13, 126, 184, 0.10);
}

.gateway-card-description {
    margin-top: 8px;
    color: var(--gateway-muted);
    font-size: 14px;
    line-height: 1.38;
}

.gateway-card-meta {
    margin-top: 7px;
    color: var(--gateway-muted);
    font-size: 13px;
    line-height: 1.35;
    word-break: break-word;
}

.gateway-card-arrow {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gateway-primary-dark);
    background: rgba(255, 255, 255, 0.52);
    font-size: 21px;
    font-weight: 800;
    border: 1px solid rgba(13, 126, 184, 0.10);
}

/*
|--------------------------------------------------------------------------
| Empty / hidden
|--------------------------------------------------------------------------
*/

.gateway-empty {
    padding: 30px;
    border-radius: 18px;
    background: rgba(224, 246, 251, 0.92);
    border: 1px solid var(--gateway-border);
    color: var(--gateway-muted);
    text-align: center;
}

.gateway-hidden {
    display: none !important;
}

/*
|--------------------------------------------------------------------------
| Responsive
|--------------------------------------------------------------------------
*/

@media (max-width: 640px) {
    .gateway-shell {
        padding: 22px 12px;
    }

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

    .gateway-user-area {
        width: 100%;
        justify-content: space-between;
    }

    .gateway-user-name {
        max-width: calc(100vw - 140px);
    }

    .gateway-panel-header {
        padding: 24px 18px 18px;
    }

    .gateway-panel-body {
        padding: 20px 18px 24px;
    }

    .gateway-card {
        min-height: 108px;
        gap: 12px;
        padding: 12px 14px;
    }

    .gateway-card-visual {
        width: 78px;
        height: 78px;
        border-radius: 16px;
    }

    .gateway-card-mark {
        border-radius: 16px;
        font-size: 26px;
    }

    .gateway-card-title {
        font-size: 17px;
    }

    .gateway-card-type,
    .gateway-card-badge {
        font-size: 12px;
        margin-top: 7px;
        padding: 4px 9px;
    }

    .gateway-card-description {
        font-size: 13px;
        margin-top: 7px;
        line-height: 1.35;
    }

    .gateway-card-arrow {
        display: none;
    }
}

/*
|--------------------------------------------------------------------------
| Gateway auth forms
|--------------------------------------------------------------------------
*/

.gateway-auth-container {
    width: min(620px, 100%);
}

.gateway-auth-top {
    margin-bottom: 28px;
}

.gateway-brand-link {
    text-decoration: none;
}

.gateway-auth-panel {
    width: 100%;
    margin: 0 auto;
}

.gateway-auth-title {
    font-size: clamp(28px, 4vw, 40px);
}

.gateway-form {
    display: grid;
    gap: 18px;
}

.gateway-field {
    display: grid;
    gap: 8px;
}

.gateway-label {
    color: var(--gateway-text);
    font-size: 14px;
    font-weight: 800;
}

.gateway-input {
    width: 100%;
    min-height: 50px;
    border-radius: 16px;
    border: 1px solid var(--gateway-border);
    background: rgba(238, 250, 253, 0.94);
    color: var(--gateway-text);
    padding: 0 16px;
    font-size: 16px;
    outline: none;
    box-shadow: 0 4px 12px rgba(16, 42, 67, 0.04);
    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        background 0.16s ease;
}

.gateway-input:focus {
    border-color: rgba(13, 126, 184, 0.55);
    box-shadow: 0 0 0 4px rgba(13, 126, 184, 0.12);
    background: rgba(255, 255, 255, 0.92);
}

.gateway-input.is-invalid {
    border-color: rgba(180, 35, 24, 0.58);
    box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.10);
}

.gateway-error-text {
    color: var(--gateway-danger, #b42318);
    font-size: 13px;
    font-weight: 700;
}

.gateway-auth-actions {
    margin-top: 4px;
}

.gateway-button {
    width: 100%;
    min-height: 50px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--gateway-primary), var(--gateway-primary-dark));
    color: #ffffff;
    font-size: 16px;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(13, 126, 184, 0.20);
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        filter 0.16s ease;
}

.gateway-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(13, 126, 184, 0.26);
    filter: brightness(1.02);
}

.gateway-button:active {
    transform: translateY(0);
}

.gateway-auth-secondary {
    text-align: center;
    margin-top: 2px;
}

.gateway-link {
    color: var(--gateway-primary-dark);
    font-weight: 800;
    text-decoration: none;
}

.gateway-link:hover {
    text-decoration: underline;
}

.gateway-alert {
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--gateway-border);
    background: rgba(255, 255, 255, 0.52);
    color: var(--gateway-text);
    font-size: 14px;
    line-height: 1.45;
}

.gateway-alert-danger {
    border-color: rgba(180, 35, 24, 0.28);
    background: rgba(255, 242, 242, 0.82);
    color: #7a271a;
}

.gateway-alert-success {
    border-color: rgba(40, 167, 69, 0.28);
    background: rgba(235, 248, 239, 0.86);
    color: #17663a;
}

.gateway-alert-title {
    font-weight: 850;
    margin-bottom: 6px;
}

.gateway-alert-list {
    margin: 0;
    padding-left: 18px;
}

@media (max-width: 640px) {
    .gateway-auth-container {
        width: 100%;
    }

    .gateway-auth-top {
        margin-bottom: 20px;
    }

    .gateway-input,
    .gateway-button {
        min-height: 48px;
    }
}

