/* Here lies the CSS concerned with the public layout */

.public-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: var(--bg-primary);
    background-image:
        radial-gradient(ellipse 55% 60% at 76% 42%, rgba(124, 42, 232, 0.22) 0%, rgba(74, 18, 150, 0.08) 45%, transparent 75%),
        radial-gradient(circle at 18% 28%, rgba(98, 28, 196, 0.08) 0%, transparent 55%),
        linear-gradient(180deg, #08020f 0%, #06020b 100%);
    overflow: hidden;
}

.public-header {
    width: 100%;
    position: relative;
    z-index: 20;
    padding: 1.1rem 0;
    background: rgba(7, 2, 13, 0.82);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-purple);
    box-shadow: 0 1px 16px rgba(124, 42, 232, 0.12);
}

.public-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.header-account {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
    min-width: 0;
}

.header-account[hidden] {
    display: none;
}

.header-account-user {
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
    height: 36px;
    padding: 0 0.8rem;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none !important;
    border: 1px solid transparent;
    border-radius: 6px;
    box-sizing: border-box;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    min-width: 0;
}

#header-username {
    display: inline-block;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.header-account-user:hover {
    background: var(--accent-subtle);
    border-color: var(--border-purple);
    color: var(--text-primary);
}

.header-account-user i {
    font-size: 1.15rem;
    line-height: 1;
    color: var(--accent-bright);
}

.header-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    height: 36px;
    padding: 0 0.8rem;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1;
    box-sizing: border-box;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-purple);
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.15s, border-color 0.15s;
}

.header-logout-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-bright);
}

[data-auth][hidden] {
    display: none !important;
}

.logo-area {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    user-select: none;
    text-decoration: none !important;
}

.brand-logo {
    height: 28px;
    width: auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(139, 61, 255, 0.45));
}

.brand-logo[src="/Images/TSW6TiLogo.png"] {
    position: relative;
}

.logo-area::before {
    content: "";
    display: inline-block;
    width: 46px;
    height: 22px;
    flex-shrink: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 28' fill='none'%3E%3Cpath d='M4 22L18 8C23 3.5 30 2 38 2H60L52 10H32C26 10 21 12.5 16 17L4 22Z' fill='%238b3dff'/%3E%3Cpath d='M8 23H58L62 19H16L8 23Z' fill='%236e21d8'/%3E%3Cpath d='M2 26H62' stroke='%238b3dff' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M26 14H48L44 17H22L26 14Z' fill='%23d8b4fe'/%3E%3C/svg%3E");
    filter: drop-shadow(0 0 8px rgba(139, 61, 255, 0.5));
}

.brand-name {
    display: inline-flex;
    align-items: center;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--text-primary);
    line-height: 1;
}

.brand-name .brand-accent {
    color: var(--accent-bright);
    margin-left: 0.15rem;
}

.brand-name .brand-ti {
    color: var(--text-primary);
    margin-left: 0.04rem;
    font-weight: 800;
}

.public-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    z-index: 10;
    padding: 2.5rem 0 1.5rem;
}

.public-content-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    height: 100vh;
    max-height: 880px;
    pointer-events: none;
    z-index: 1;
    background-image:
        linear-gradient(90deg, #07020d 0%, rgba(7, 2, 13, 0.9) 32%, rgba(7, 2, 13, 0.25) 62%, rgba(7, 2, 13, 0.1) 100%),
        linear-gradient(180deg, rgba(7, 2, 13, 0.3) 0%, rgba(7, 2, 13, 0.05) 55%, rgba(7, 2, 13, 0.88) 84%, #07020d 100%),
        url("/Images/Landing%20Backdrop.png");
    background-repeat: no-repeat;
    background-position: center right;
    background-size: cover;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0) 100%);
}

.public-content-wrapper>.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    z-index: 5;
}

#alert-container {
    position: fixed;
    top: 86px;
    right: 1.5rem;
    z-index: 450;
    width: min(380px, calc(100vw - 2rem));
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
}

#alert-container:empty {
    display: none;
}

#alert-container .alert {
    pointer-events: auto;
    margin: 0;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    background: rgba(16, 8, 28, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-purple-strong);
    border-left: 3px solid var(--accent-bright);
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    animation: publicAlertSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes publicAlertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px) translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }
}

#alert-container .alert-success {
    border-color: rgba(34, 197, 94, 0.45);
    border-left-color: #22c55e;
}

#alert-container .alert-danger {
    border-color: rgba(244, 63, 94, 0.55);
    border-left-color: #fb7185;
}

#alert-container .alert-warning {
    border-color: rgba(245, 158, 11, 0.5);
    border-left-color: #f59e0b;
}

#alert-container .alert-info {
    border-color: rgba(139, 61, 255, 0.5);
    border-left-color: var(--accent-bright);
}

.alert-toast-content {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.alert-success .alert-toast-content i {
    color: #22c55e;
}

.alert-danger .alert-toast-content i {
    color: #fb7185;
}

.alert-warning .alert-toast-content i {
    color: #f59e0b;
}

.alert-info .alert-toast-content i {
    color: var(--accent-bright);
}

.alert-toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.15rem 0.25rem;
    font-size: 0.85rem;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}

.alert-toast-close:hover {
    color: var(--text-primary);
}

@media (max-width: 767.98px) {
    .public-header {
        padding: 0.75rem 0;
    }

    .public-header .container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        width: 100%;
    }

    .logo-area {
        gap: 0.5rem;
        flex-shrink: 0;
    }

    .logo-area::before {
        width: 36px;
        height: 18px;
    }

    .brand-name {
        font-size: 1.25rem;
    }

    .header-account {
        display: inline-flex;
        align-items: center;
        gap: 0.6rem;
        margin-left: auto;
        flex-shrink: 0;
    }

    .header-account-user {
        height: 36px;
        padding: 0 0.65rem;
        gap: 0.38rem;
        font-size: 0.84rem;
        max-width: 135px;
    }

    .header-account-user i {
        font-size: 1.05rem;
    }

    #header-username {
        max-width: 85px;
    }

    .header-logout-btn {
        width: 36px;
        height: 36px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .header-logout-btn span {
        display: none;
    }

    .header-logout-btn i {
        font-size: 1rem;
        margin: 0;
    }
}

@media (max-width: 576px) {
    #alert-container {
        top: 80px;
        right: 1rem;
        left: 1rem;
        width: auto;
    }

    .public-header .container {
        padding-left: 1rem;
        padding-right: 1rem;
        gap: 0.5rem;
    }

    .brand-name {
        font-size: 1.18rem;
    }

    .header-account {
        gap: 0.45rem;
    }

    .header-account-user {
        padding: 0 0.55rem;
        max-width: 120px;
        font-size: 0.82rem;
    }

    #header-username {
        max-width: 70px;
    }
}

@media (max-width: 420px) {
    .public-header .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        gap: 0.4rem;
    }

    .logo-area {
        gap: 0.35rem;
    }

    .logo-area::before {
        width: 32px;
        height: 16px;
    }

    .brand-name {
        font-size: 1.1rem;
    }

    .header-account-user {
        padding: 0 0.45rem;
        max-width: 105px;
    }

    #header-username {
        max-width: 60px;
    }
}

@media (max-width: 350px) {
    #header-username {
        display: none;
    }

    .header-account-user {
        padding: 0 0.5rem;
        max-width: none;
    }
}