/* MYSCOPE Login Page Styles
   Brand look from myscope.de: graphite #111111 / #272727, white text, accent violet #8C46FF, Montserrat.
   Logo: /css/myscope/logo.png (white wordmark, transparent) */

@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap");

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem;
    padding-top: 10vh;
    position: relative;
    overflow: hidden;
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Cinematic background: graphite with violet glow */
.login-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(1100px 620px at 16% 86%, rgba(140, 70, 255, 0.26) 0%, rgba(140, 70, 255, 0) 58%),
        radial-gradient(900px 560px at 84% 18%, rgba(108, 46, 214, 0.2) 0%, rgba(108, 46, 214, 0) 60%),
        radial-gradient(820px 420px at 50% 104%, rgba(170, 118, 255, 0.1) 0%, rgba(170, 118, 255, 0) 56%),
        linear-gradient(128deg, #0b0b0b 0%, #141414 36%, #1f1f1f 62%, #101010 100%);
    background-size: 130% 130%, 125% 125%, 145% 145%, 100% 100%;
    background-position: 0% 72%, 100% 18%, 50% 100%, 0 0;
    animation: myscope-drift 24s ease-in-out infinite alternate;
}

.login-background::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(900px 640px at 50% 24%, rgba(0, 0, 0, 0.9) 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(900px 640px at 50% 24%, rgba(0, 0, 0, 0.9) 0%, transparent 75%);
}

.login-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(92px);
    opacity: 0.42;
    animation: myscope-float 22s infinite ease-in-out;
}

.login-shape:nth-child(1) {
    width: 520px;
    height: 520px;
    background: linear-gradient(135deg, #8c46ff 0%, #aa76ff 100%);
    top: -260px;
    left: -230px;
    animation-delay: 0s;
}

.login-shape:nth-child(2) {
    width: 430px;
    height: 430px;
    background: linear-gradient(135deg, #5222a8 0%, #6c2ed6 100%);
    bottom: -220px;
    right: -190px;
    animation-delay: -11s;
}

@keyframes myscope-drift {
    0% {
        background-position: 0% 72%, 100% 18%, 50% 100%, 0 0;
    }

    100% {
        background-position: 10% 60%, 88% 30%, 44% 96%, 0 0;
    }
}

@keyframes myscope-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(46px, 42px) scale(1.07);
    }

    50% {
        transform: translate(24px, -30px) scale(0.93);
    }

    75% {
        transform: translate(-42px, 28px) scale(1.03);
    }
}

/* Login Card */
.login-card {
    position: relative;
    overflow: hidden;
    background: rgba(24, 24, 24, 0.82);
    backdrop-filter: blur(22px) saturate(1.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    padding: 3rem;
    width: 100%;
    max-width: 480px;
    color: #e8e8e8;
    box-shadow:
        0 30px 78px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    animation: slideUp 0.6s ease-out;
}

.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #5222a8 0%, #8c46ff 50%, #c9adff 100%);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo {
    content: url('/css/myscope/logo.png');
    width: min(280px, 84%);
    height: auto;
    display: block;
    margin: 0 auto 1.1rem;
    filter: drop-shadow(0 0 14px rgba(140, 70, 255, 0.35));
}

.login-logo-icon {
    content: url('/css/myscope/favicon.png');
    width: 64px;
    height: 64px;
    display: block;
    margin: 0 auto 0.75rem;
    border-radius: 12px;
    filter: drop-shadow(0 0 12px rgba(140, 70, 255, 0.5));
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #c9adff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: #b3b3b3;
    font-size: 0.95rem;
    margin: 0;
}

/* Form */
.login-content {
    width: 100%;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #e8e8e8;
    font-size: 0.9rem;
    font-weight: 600;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    font-size: 1.2rem;
    pointer-events: none;
    z-index: 1;
    filter: grayscale(1) brightness(1.6);
    opacity: 0.8;
}

.form-control-modern {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 3rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    color: #f5f5f5;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-control-modern::placeholder {
    color: #8a8a8a;
}

.form-control-modern:hover {
    border-color: rgba(255, 255, 255, 0.26);
}

.form-control-modern:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: #8c46ff;
    box-shadow: 0 0 0 3px rgba(140, 70, 255, 0.28);
}

.twofactor-subtext {
    color: #b3b3b3;
    margin-bottom: 1.5rem;
    font-size: 0.92rem;
    line-height: 1.45;
}

.twofactor-code-input {
    letter-spacing: 0.18rem;
    font-weight: 600;
}

.twofactor-code-input::placeholder {
    letter-spacing: normal;
    font-weight: 400;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: #d0d0d0;
    font-size: 0.9rem;
    margin: 0;
}

.checkbox-modern {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #8c46ff;
}

.forgot-password {
    color: #aa76ff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #c9adff;
    text-decoration: underline;
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #6c2ed6 0%, #8c46ff 55%, #aa76ff 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.02em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 22px rgba(140, 70, 255, 0.38);
}

.btn-login:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #7a3ae8 0%, #9a5cff 55%, #ba8dff 100%);
    box-shadow: 0 12px 26px rgba(140, 70, 255, 0.48);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:focus-visible {
    outline: none;
    box-shadow:
        0 8px 22px rgba(140, 70, 255, 0.38),
        0 0 0 3px rgba(201, 173, 255, 0.55);
}

.btn-login .arrow {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.btn-login:hover .arrow {
    transform: translateX(4px);
}

/* Footer Links */
.login-footer {
    margin-top: 2rem;
    text-align: center;
}

.login-footer p {
    color: #b3b3b3;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}

.link-register {
    color: #aa76ff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.link-register:hover {
    color: #c9adff;
}

.link-secondary {
    color: #8a8a8a;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.link-secondary:hover {
    color: #f0f0f0;
}

/* External Login Section */
.external-login-section {
    margin-top: 2rem;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 2rem 0 1.5rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.divider span {
    padding: 0 1rem;
    color: #8a8a8a;
    font-size: 0.85rem;
}

/* Validation Messages */
.validation-summary {
    background: rgba(255, 93, 122, 0.14);
    border: 1px solid rgba(255, 93, 122, 0.45);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.validation-summary-info {
    background: rgba(140, 70, 255, 0.14);
    border-color: rgba(140, 70, 255, 0.45);
}

.text-danger {
    color: #ff8098 !important;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: block;
}

/* Alert / Status Messages */
.alert {
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.alert-danger {
    background: rgba(255, 93, 122, 0.14);
    border: 1px solid rgba(255, 93, 122, 0.46);
    color: #ff8098;
}

.alert-success {
    background: rgba(60, 207, 142, 0.12);
    border: 1px solid rgba(60, 207, 142, 0.45);
    color: #66dca7;
}

.login-info-text {
    color: rgba(232, 232, 232, 0.9);
}

.btn-login-link {
    text-decoration: none;
}

/* External Login Buttons */
.external-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-external-login {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #e8e8e8;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.btn-external-login:hover {
    background: rgba(140, 70, 255, 0.14);
    border-color: #8c46ff;
    transform: translateY(-1px);
}

.btn-external-microsoft:hover { border-color: #00a4ef; }
.btn-external-google:hover    { border-color: #4285f4; }
.btn-external-azuread:hover   { border-color: #0078d4; }
.btn-external-okta:hover      { border-color: #007dc1; }

/* Responsive */
@media (max-width: 640px) {
    .login-card {
        padding: 2rem 1.5rem;
    }

    .login-header h1 {
        font-size: 1.75rem;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
