/* style.css (Redesign based on user-provided image) */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700;900&display=swap');

:root {
    --bg-dark-purple: #231B34;
    --bg-glass: rgba(20, 16, 30, 0.7);
    --accent-pink: #F92C85;
    --accent-cyan: #05D9E8;
    --text-light: #EAEBF0;
    --text-muted: #A09CB3;
    --border-color: rgba(5, 217, 232, 0.3);
    --glow-pink: rgba(249, 44, 133, 0.5);
    --glow-cyan: rgba(5, 217, 232, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', sans-serif;
    color: var(--text-light);
    background-color: var(--bg-dark-purple);
    overflow: hidden;
    direction: rtl;
    display: flex;
    align-items: center;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('../../images/bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    animation: smooth-zoom 20s ease-in-out infinite alternate;
}


/* --- Splash Screen (Kept As Is) --- */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark-purple);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
}

#splash-logo {
    max-width: 250px;
    width: 70%;
    animation: zoomFadeIn 1.5s ease-out forwards;
}

@keyframes zoomFadeIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

body.loaded #splash-screen {
    opacity: 0;
    visibility: hidden;
}

body.loaded {
    overflow: auto;
}

/* --- Main Layout --- */
#main-content {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    /* Align form to the left in RTL */
    align-items: center;
    min-height: 100vh;
    padding: 40px 15%;
    /* ADJUSTED: Increased horizontal padding to move form from the edge */
}

body.loaded #main-content {
    opacity: 1;
}

/* --- Form Container --- */
.form-container {
    width: 100%;
    max-width: 450px;
    background-color: var(--bg-glass);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 20px var(--glow-cyan);
    position: relative;
    overflow: hidden;
}

.page-logo {
    position: absolute; 
    top: -15px; 
    left: -15px;
    max-width: 100px;
    opacity: 0.2;
    z-index: 0; 
    pointer-events: none;
}

.form-container h1 {
    font-size: 2.2em;
    font-weight: 900;
    margin-bottom: 5px;
    color: var(--text-light);
    text-shadow: 0 0 10px var(--glow-cyan);
    text-align: center;
    position: relative;
    z-index: 1;
}

.form-container .subtitle {
    color: var(--text-muted);
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* --- Form Elements --- */
.form-group {
    text-align: right;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--text-muted);
}

.input-group {
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 14px 45px 14px 15px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-light);
    font-size: 1em;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px var(--glow-cyan);
}

.input-group .input-icon {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* --- Platform Selector --- */
.platform-selector {
    margin-bottom: 25px;
    text-align: right;
    padding: 15px;
    background-color: rgba(0,0,0, 0.2);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.selector-title {
    font-size: 1.1em;
    color: var(--text-light);
    margin-bottom: 15px;
    font-weight: 700;
}

.platform-options {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.platform-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
}

.platform-option img {
    width: 25px;
    height: 25px;
    margin-left: 8px;
}

.platform-option:hover {
    background-color: rgba(5, 217, 232, 0.1);
}

.platform-option.selected {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px var(--glow-cyan);
    background-color: rgba(5, 217, 232, 0.1);
}

.platform-option input {
    display: none;
}

/* --- Submit Button --- */
.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(90deg, var(--accent-pink), var(--accent-cyan));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    margin-top: 10px;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--glow-pink);
    filter: brightness(1.2);
}

.submit-btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 4px 15px var(--glow-pink);
}

/* --- SweetAlert Theming --- */
.swal2-popup {
    background-color: var(--bg-glass) !important;
    border: 1px solid var(--border-color) !important;
    backdrop-filter: blur(5px);
}

.swal2-title,
.swal2-html-container {
    color: var(--text-light) !important;
}

.swal2-confirm-button {
    background: linear-gradient(90deg, var(--accent-pink), var(--accent-cyan)) !important;
}

.swal2-select {
    background-color: var(--bg-dark-purple) !important;
    color: var(--text-light) !important;
    border: 1px solid var(--border-color) !important;
}

.swal2-select option {
    background-color: var(--bg-dark-purple) !important;
    color: var(--text-light) !important;
}

/* --- Responsive for mobile --- */
@media (max-width: 768px) {
    body {
        background-position: 70% center;
        /* Adjust background for better visibility */
    }

    #main-content {
        justify-content: center;
        /* Center form on mobile */
        padding: 20px;
    }

    .form-container {
        padding: 30px;
    }
}

/* --- Animations for Form Elements --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply animation to elements with a delay */
.form-container h1 {
    animation: fadeInUp 0.5s ease-out 0.8s backwards;
}

.form-container .subtitle {
    animation: fadeInUp 0.5s ease-out 1s backwards;
}

.platform-options,
.form-group,
.submit-btn {
    animation: fadeInUp 0.5s ease-out backwards;
}

/* Stagger the animation for a smoother effect */
.platform-options {
    animation-delay: 1.2s;
}

.form-group:nth-of-type(1) {
    animation-delay: 1.4s;
}

.form-group:nth-of-type(2) {
    animation-delay: 1.6s;
}

.submit-btn {
    animation-delay: 1.8s;
}


@keyframes smooth-zoom {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.05);
    }
}