/* =================================================================== */
/* GLOBAL AUTH STYLES (for login, register, reset, etc.) */
/* =================================================================== */
:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --dark-color: #2d3436;
    --light-color: #f8f9fa;
    --accent-color: #00cec9;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    color: var(--dark-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* =================================================================== */
/* MAIN LAYOUT & CONTAINERS */
/* =================================================================== */
.logo-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 15px;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
}

.logo img {
    height: 40px;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.logo-icon i {
    color: white;
    font-size: 1.5rem;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.tagline {
    color: #636e72;
    font-size: 1rem;
}

.auth-container {
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: #636e72;
}

/* =================================================================== */
/* FORM ELEMENTS */
/* =================================================================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-label.required::after {
    content: "*";
    color: red;
    margin-left: 4px;
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    z-index: 5;
}

.form-control {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 45px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    height: 50px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.25);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.remember-me {
    display: flex;
    align-items: center;
}

.remember-me input {
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
    accent-color: var(--primary-color);
}

.remember-me label {
    color: var(--dark-color);
    font-size: 0.9rem;
}

.forgot-password {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.phone-container {
    display: flex;
    gap: 0.5rem;
}

.country-code {
    flex: 0 0 30%;
}

.phone-number {
    flex: 1;
}

.country-code select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    height: 50px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
}

.password-info {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.5rem;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    cursor: pointer;
    z-index: 10;
}

/* =================================================================== */
/* BUTTONS & LINKS */
/* =================================================================== */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none; /* For <a> tags styled as buttons */
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Spinner for register button */
#registerBtn {
    position: relative;
}

.half-circle-spinner {
    width: 18px;
    height: 18px;
    border-radius: 100%;
    position: relative;
}

.half-circle-spinner .circle {
    position: absolute;
    border: 3px solid #fff;
    width: 100%;
    height: 100%;
    border-radius: 100%;
    clip: rect(0px, 18px, 18px, 9px);
    animation: spin 1s infinite linear;
}

.half-circle-spinner .circle-1 {
    border-top-color: transparent;
    border-left-color: transparent;
}

.half-circle-spinner .circle-2 {
    border-bottom-color: transparent;
    border-right-color: transparent;
    animation-delay: 0.5s;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.bottom-link {
    text-align: center;
    margin-top: 1.5rem;
}

.bottom-link p {
    color: #636e72;
    margin-bottom: 0;
}

.bottom-link a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.bottom-link a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* =================================================================== */
/* ALERTS & MESSAGES */
/* =================================================================== */
.alert {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.alert-danger {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #e53e3e;
}

.alert-success {
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    color: #38a169;
}

.alert i {
    margin-right: 8px;
}

/* =================================================================== */
/* OTP FORM (from register.php) */
/* =================================================================== */
.otp-container {
    text-align: center;
}

.otp-icon {
    width: 80px;
    height: 80px;
    background: #e6f2ff;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

.otp-icon i {
    font-size: 2rem;
    color: #4299e1;
}

.otp-input-group {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.otp-digit {
    width: 3.5rem;
    height: 3.5rem;
    text-align: center;
    font-size: 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    outline: none;
    transition: all 0.2s ease-in-out;
    font-family: 'Poppins', sans-serif;
    padding: 0; /* Override other form-control padding */
}

.otp-digit:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.25);
}

/* =================================================================== */
/* SUCCESS PAGE (from register.php function) */
/* =================================================================== */
.success-container {
    text-align: center;
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(108, 92, 231, 0.2);
    max-width: 500px;
    width: 90%;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: rgba(108, 92, 231, 0.1);
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

.success-icon i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.success-container h1 {
    color: #2d3436;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.success-container p {
    color: #636e72;
    margin: 0.5rem 0;
}

.progress-bar {
    width: 100%;
    background: #e2e8f0;
    border-radius: 99px;
    height: 8px;
    margin: 1.5rem 0;
    overflow: hidden;
}

.progress {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    animation: progress 3s linear forwards;
}

@keyframes progress {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

/* =================================================================== */
/* MODAL (from login.php) */
/* =================================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.modal.show {
    visibility: visible;
    opacity: 1;
}

.modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 15px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

.modal-content h2 {
    color: #e53e3e;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.modal-content p {
    color: #555;
    margin-bottom: 1.5rem;
}

.modal-content .btn-telegram {
    background: #0088cc;
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s ease;
}

.modal-content .btn-telegram:hover {
    background: #006f9e;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* =================================================================== */
/* RESPONSIVE MEDIA QUERIES */
/* =================================================================== */
@media (max-width: 576px) {
    .auth-container {
        padding: 2rem 1.5rem;
    }
    .logo-text {
        font-size: 1.5rem;
    }
    .tagline {
        font-size: 0.9rem;
    }
    .auth-header h1 {
        font-size: 1.5rem;
    }
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .forgot-password {
        margin-left: 1.8rem;
    }
}