/* =========================================
   AI TUTORS - WELCOME 1
   Independent responsive welcome design
   ========================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    min-height: 100%;
}

body.welcome1-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    color: #f1f6ff;
    background: #071326;
    font-family: Inter, Arial, sans-serif;
}

/* Main background */

#welcome1Wrap {
    position: relative;
    isolation: isolate;
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 55px 22px;
    overflow: hidden;

    background:
        radial-gradient(ellipse at 10% 15%, rgba(37, 99, 235, .24), transparent 42%),
        radial-gradient(ellipse at 90% 85%, rgba(14, 165, 233, .20), transparent 42%),
        linear-gradient(135deg, #071326, #102442 55%, #08172d);
}

/* Soft glowing background effects */

.welcome1-glow {
    position: absolute;
    z-index: -1;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    animation: welcome1Glow 8s ease-in-out infinite alternate;
}

.welcome1-glow-one {
    top: 5%;
    left: -150px;
    background: rgba(37, 99, 235, .20);
}

.welcome1-glow-two {
    right: -150px;
    bottom: 5%;
    background: rgba(14, 165, 233, .18);
    animation-delay: -4s;
}

/* Floating multilingual greetings */

#greetingBackground1 {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

#greetingBackground1 span {
    position: absolute;
    color: #60a5fa;
    opacity: .13;
    font-size: clamp(16px, 2.2vw, 27px);
    font-weight: 700;
    letter-spacing: .12em;
    white-space: nowrap;
    animation: welcome1Float 9s ease-in-out infinite alternate;
}

#greetingBackground1 span:nth-child(1) {
    top: 9%; left: 7%;
    animation-delay: -1s;
}
#greetingBackground1 span:nth-child(2) {
    top: 19%; right: 8%;
    animation-delay: -3s;
}
#greetingBackground1 span:nth-child(3) {
    top: 39%; left: 5%;
    animation-delay: -5s;
}
#greetingBackground1 span:nth-child(4) {
    top: 53%; right: 6%;
    animation-delay: -2s;
}
#greetingBackground1 span:nth-child(5) {
    top: 76%; left: 8%;
    animation-delay: -4s;
}
#greetingBackground1 span:nth-child(6) {
    top: 88%; right: 12%;
    animation-delay: -6s;
}
#greetingBackground1 span:nth-child(7) {
    top: 30%; left: 72%;
    animation-delay: -2s;
}
#greetingBackground1 span:nth-child(8) {
    top: 68%; left: 42%;
    animation-delay: -5s;
}
#greetingBackground1 span:nth-child(9) {
    top: 7%; left: 43%;
    animation-delay: -3s;
}
#greetingBackground1 span:nth-child(10) {
    top: 91%; left: 35%;
    animation-delay: -7s;
}
#greetingBackground1 span:nth-child(11) {
    top: 44%; left: 38%;
    animation-delay: -1s;
}
#greetingBackground1 span:nth-child(12) {
    top: 60%; right: 30%;
    animation-delay: -4s;
}

/* Welcome card */

#welcome1Card {
    position: relative;
    z-index: 1;
    width: min(100%, 680px);
    padding: clamp(32px, 6vw, 58px);
    text-align: center;

    background: rgba(13, 30, 54, .88);
    border: 1px solid rgba(96, 165, 250, .35);
    border-radius: 26px;

    box-shadow:
        0 24px 70px rgba(0, 0, 0, .35),
        0 0 40px rgba(37, 99, 235, .12);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    animation: welcome1Enter 1.1s cubic-bezier(.2, .75, .25, 1) both;
}

.welcome1-label {
    margin-bottom: 24px;
    color: #93c5fd;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .22em;
}

.welcome1-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 66px;
    height: 66px;
    margin: 0 auto 25px;
    border: 1px solid rgba(96, 165, 250, .45);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(37, 99, 235, .35), rgba(14, 165, 233, .15));
    box-shadow: 0 0 35px rgba(37, 99, 235, .20);
    animation: welcome1IconFloat 4s ease-in-out infinite;
}

.welcome1-icon span {
    color: #93c5fd;
    font-size: 34px;
}

#welcome1Card h1 {
    margin: 0 0 16px;
    color: #f1f6ff;
    font-size: clamp(32px, 5.5vw, 49px);
    font-weight: 750;
    line-height: 1.18;
    letter-spacing: -.035em;
}

.welcome1-brand {
    display: inline-block;
    color: #60a5fa;
    text-shadow: 0 0 28px rgba(59, 130, 246, .35);
}

.welcome1-subtitle {
    margin: 0;
    color: #bfdbfe;
    font-size: clamp(17px, 2.5vw, 21px);
    line-height: 1.6;
    animation: welcome1TextAppear 1.5s .3s both;
}

.welcome1-divider {
    width: 70px;
    height: 3px;
    margin: 28px auto;
    border-radius: 10px;
    background: linear-gradient(90deg, #2563eb, #38bdf8);
}

.welcome1-description {
    max-width: 490px;
    margin: 0 auto;
    color: #b6c7df;
    font-size: 16px;
    line-height: 1.85;
    animation: welcome1TextAppear 1.5s .5s both;
}

.welcome1-bottom-text {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    color: #93c5fd;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: .12em;
}

.welcome1-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 12px #38bdf8;
    animation: welcome1Pulse 2s infinite;
}

/* Footer */

.welcome1-footer {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    width: 100%;
    padding: 24px clamp(20px, 5vw, 60px) 16px;
    color: #a9bad2;
    background: #08172d;
    border-top: 1px solid rgba(96, 165, 250, .12);
}

.welcome1-footer-main {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
}

.welcome1-about {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.welcome1-about h2 {
    margin: 0 0 10px;
    color: #ffffff;
    font-size: 17px;
}

.welcome1-about h3 {
    margin: 18px 0 6px;
    color: #ffffff;
    font-size: 15px;
}

.welcome1-about p {
    margin: 5px 0;
    font-size: 13px;
    line-height: 1.6;
}

.welcome1-footer-links {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    padding-top: 4px;
}

.welcome1-footer a {
    color: #bfdbfe;
    font-size: 14px;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.welcome1-footer a:hover {
    color: white;
}

.welcome1-copyright {
    width: 100%;
    margin: 22px 0 0;
    text-align: center;
    font-size: 13px;
}

/* Animations */

/* Animations */

@keyframes welcome1Enter {
    from {
        opacity: 0;
        transform: translateY(35px) scale(.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes welcome1TextAppear {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes welcome1Float {
    from {
        transform: translate3d(0, -12px, 0);
    }
    to {
        transform: translate3d(0, 16px, 0);
    }
}

@keyframes welcome1IconFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-7px);
    }
}

@keyframes welcome1Glow {
    from {
        opacity: .55;
        transform: scale(.9);
    }
    to {
        opacity: 1;
        transform: scale(1.15);
    }
}

@keyframes welcome1Pulse {
    0%, 100% {
        opacity: .55;
        transform: scale(.85);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Tablet */

@media (min-width: 521px) and (max-width: 1024px) {
    #welcome1Wrap {
        padding: 55px 32px;
    }

    #welcome1Card {
        width: min(100%, 720px);
        padding: 52px 42px;
    }

    #greetingBackground1 {
        min-height: 100%;
    }
}

/* Phone */

@media (max-width: 520px) {
    #welcome1Wrap {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 35px 16px;
    }

    #welcome1Card {
        width: 100%;
        padding: 34px 22px;
        border-radius: 20px;
    }

    .welcome1-label {
        font-size: 10px;
        letter-spacing: .16em;
    }

    .welcome1-icon {
        width: 56px;
        height: 56px;
    }

    #welcome1Card h1 {
        font-size: clamp(30px, 8vw, 39px);
    }

    .welcome1-description {
        font-size: 15px;
    }

    #greetingBackground1 span {
        font-size: 15px;
    }

    .welcome1-footer nav {
        gap: 12px 18px;
    }
}

/* Short screens */

@media (max-height: 650px) {
    #welcome1Wrap {
        padding-top: 25px;
        padding-bottom: 25px;
    }

    #welcome1Card {
        padding-top: 28px;
        padding-bottom: 28px;
    }

    .welcome1-icon {
        margin-bottom: 15px;
    }
}

/* Respect reduced-motion preferences */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}

/* =========================================
   REGISTER AND LOGIN CARDS
   ========================================= */

#welcome1Wrap {
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    padding-top: 55px;
    padding-bottom: 55px;
}

#welcome1Card {
    flex-shrink: 0;
    width: min(100%, 760px);
    padding: clamp(26px, 4vw, 42px);
}

#welcomeGuestIntro[hidden],
.welcome1-form-panel[hidden] {
    display: none !important;
}

.welcome1-account-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    width: min(100%, 760px);
    animation: welcome1Enter 1.1s .2s both;
}

.welcome1-account-card {
    min-width: 0;
    padding: 30px 26px;
    text-align: center;
    background: rgba(13, 30, 54, .91);
    border: 1px solid rgba(96, 165, 250, .30);
    border-radius: 22px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform .25s ease, border-color .25s ease,
                box-shadow .25s ease;
}

.welcome1-account-card:hover {
    transform: translateY(-5px);
    border-color: rgba(96, 165, 250, .65);
    box-shadow: 0 22px 48px rgba(0, 0, 0, .32);
}

.welcome1-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 18px;
    border-radius: 16px;
    color: #bfdbfe;
    background: rgba(37, 99, 235, .22);
    border: 1px solid rgba(96, 165, 250, .35);
    font-size: 30px;
    font-weight: 400;
}

.welcome1-account-card h2 {
    margin: 0 0 12px;
    color: #f1f6ff;
    font-size: 22px;
    font-weight: 700;
}

.welcome1-account-card > p {
    min-height: 52px;
    margin: 0 auto 22px;
    max-width: 310px;
    color: #b6c7df;
    font-size: 14px;
    line-height: 1.7;
}

.welcome1-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease,
                box-shadow .2s ease, opacity .2s ease;
}

.welcome1-button:hover:not(:disabled) {
    transform: translateY(-2px);
}

.welcome1-button:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 3px;
}

.welcome1-button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.welcome1-register-button {
    background: linear-gradient(110deg, #2563eb, #0284c7);
    box-shadow: 0 8px 22px rgba(37, 99, 235, .24);
}

.welcome1-register-button:hover:not(:disabled) {
    background: linear-gradient(110deg, #1d4ed8, #0369a1);
}

.welcome1-login-button {
    color: #dbeafe;
    background: rgba(30, 64, 115, .55);
    border-color: rgba(96, 165, 250, .45);
}

.welcome1-login-button:hover:not(:disabled) {
    background: rgba(37, 99, 235, .35);
}

.welcome1-form-panel {
    margin-top: 25px;
    padding-top: 22px;
    border-top: 1px solid rgba(147, 197, 253, .20);
    text-align: left;
}

.welcome1-form-panel h3 {
    margin: 0 0 8px;
    color: #f1f6ff;
    font-size: 19px;
    text-align: center;
}

.welcome1-form-panel > p {
    margin: 0 0 20px;
    color: #a9bad2;
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
}

.welcome1-form-panel form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.welcome1-form-panel label {
    margin-top: 5px;
    color: #dbeafe;
    font-size: 13px;
    font-weight: 650;
}

.welcome1-form-panel input {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid rgba(147, 197, 253, .30);
    border-radius: 10px;
    outline: none;
    color: #f1f6ff;
    background: rgba(3, 12, 27, .65);
    font: inherit;
    font-size: 14px;
}

.welcome1-form-panel input::placeholder {
    color: #8094b1;
}

.welcome1-form-panel input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .16);
}

.welcome1-form-panel button[type="submit"] {
    margin-top: 12px;
}

.welcome1-session {
    margin-top: 20px;
    text-align: center;
}

#welcomeStatus {
    min-height: 0;
    margin: 0;
    color: #bfdbfe;
    font-size: 14px;
    line-height: 1.6;
}

#welcomeStatus:not(:empty) {
    margin-bottom: 12px;
}

#welcomeStatus.is-success {
    color: #86efac;
}

#welcomeStatus.is-error {
    color: #fca5a5;
}

#welcome1Card #logoutBtn {
    max-width: 220px;
}

@media (max-width: 650px) {
    #welcome1Wrap {
        min-height: auto;
        padding: 35px 16px;
        gap: 18px;
    }

    #welcome1Card {
        padding: 28px 20px;
        border-radius: 21px;
    }

    .welcome1-account-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .welcome1-account-card {
        padding: 26px 22px;
    }

    .welcome1-account-card > p {
        min-height: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .welcome1-account-card,
    .welcome1-button {
        transition: none;
    }

    .welcome1-account-card:hover,
    .welcome1-button:hover:not(:disabled) {
        transform: none;
    }
}


/* Sign-in section integrated into the main welcome card */
.welcome1-login-inline {
    width: min(100%, 460px);
    margin: 30px auto 0;
    text-align: center;
}

.welcome1-login-inline h2 {
    margin: 0 0 10px;
    color: #f1f6ff;
    font-size: 22px;
    font-weight: 700;
}

.welcome1-login-inline > p {
    max-width: 420px;
    margin: 0 auto;
    color: #b6c7df;
    font-size: 14px;
    line-height: 1.7;
}

.welcome1-login-inline .welcome1-form-panel {
    margin-top: 20px;
    padding-top: 0;
    border-top: 0;
}


/* Student Guide link */
.welcome1-guide-link {
    display: inline-block;
    margin: 0 8px 6px;
    padding: 7px 13px;
    border: 1px solid rgba(150, 190, 255, .45);
    border-radius: 7px;
    color: #b8d2ff;
    text-decoration: none;
    font-weight: 700;
}
.welcome1-guide-link:hover {
    background: rgba(100, 155, 235, .14);
    color: #fff;
}
