@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #2563eb;       
    --primary-hover: #1d4ed8;       
    --text-main: #0f172a;           
    --text-muted: #475569;          
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); 
    --border-color: rgba(255, 255, 255, 0.15);
    --input-focus: #3b82f6;
    --shadow-md: 0 20px 40px rgba(0, 0, 0, 0.3);
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #ffffff;
    overflow: hidden; 
    position: relative;
}

.backgroundglow {
    position: fixed; 
    border-radius: 50%;
    filter: blur(80px);
    z-index: 1;
    opacity: 0.3; 
    pointer-events: none; 
    animation: pulseGlow 8s infinite alternate ease-in-out;
}

.glow1 {
    width: 300px;
    height: 300px;
    background: #3b82f6; 
    top: -50px;
    right: -50px;
}

.glow2 {
    width: 350px;
    height: 350px;
    background: #10b981; 
    bottom: -80px;
    left: -80px;
    animation-delay: 4s;
}

@keyframes pulseGlow {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.2) translate(30px, 20px); }
}

.logincontainer {
    background: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px);
    width: 100%;
    max-width: 430px;
    padding: 40px 35px;
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.4);
    z-index: 2; 
    animation: fadeInUp 0.6s var(--transition-smooth);
}

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

.loginheader {
    text-align: center;
    margin-bottom: 35px;
}

.loginheader h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.loginheader p {
    font-size: 14px;
    color: var(--text-muted);
}

.loginform {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.formgroup {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.labelwrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.forgotpassword {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

.forgotpassword:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    background-color: rgba(248, 250, 252, 0.8);
    color: var(--text-main);
    text-align: right;
    transition: var(--transition-smooth);
}

input::placeholder {
    color: #475569;
    font-size: 17px;
}

input:focus {
    outline: none;
    background-color: #ffffff;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

input[type="email"] {
    direction: ltr;
    text-align: right;
}

.btnsubmit {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    background-color: var(--primary-color);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-top: 10px;
}

.btnsubmit:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.btnsubmit:active {
    transform: translateY(1px);
}

.loginfooter {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.loginfooter p {
    font-size: 14px;
    color: var(--text-muted);
}

.loginfooter a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
}

.loginfooter a:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

@media (max-width: 480px) {
    .logincontainer {
        padding: 30px 20px;
        border-radius: 20px;
    }

}

#loadingoverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #000000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 20px;
    transition: opacity 0.5s ease;
    display: flex;
    flex-direction: column;
}

#loadingoverlay h2 {
    color:#f59e0b;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.1);
    border-top-color: #f59e0b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom:20px;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.errortext {
    color: red;
    font-size: 10px;
    margin-top: 3px;
    display: block; 
}

.hidden {
    display: none !important;
}

#resetModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeInBg 0.3s ease-out;
}

#resetSection {
    background-color: #ffffff;
    padding: 32px;
    border-radius: 20px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    text-align: right;
    box-sizing: border-box;
    animation: scaleInChild 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#resetSection h2 {
    color: #1e293b;
    font-size: 22px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 8px;
    text-align: center;
}

#resetSection .subtitle {
    color: #64748b;
    font-size: 14px;
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.5;
}

.inputgroup {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inputgroup label {
    color: #475569;
    font-size: 14px;
    font-weight: 600;
}

#resetEmail {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 16px;
    background-color: #f8fafc;
    color: #334155;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

#resetEmail:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

#resetBtn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    margin-top: 10px;
}

#resetBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
}

#resetBtn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.switchtext {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    margin-bottom: 0;
}

#backToLogin {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

#backToLogin:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

@keyframes fadeInBg {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleInChild {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.eye-btn {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  line-height: 1;
  user-select: none;
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
