Spaces:
Sleeping
Sleeping
Update src/app.py
Browse files- src/app.py +244 -110
src/app.py
CHANGED
|
@@ -313,92 +313,182 @@ _PLOT_LAYOUT = dict(
|
|
| 313 |
|
| 314 |
|
| 315 |
def render_login():
|
| 316 |
-
"""
|
| 317 |
|
| 318 |
st.markdown("""
|
| 319 |
<style>
|
| 320 |
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300&family=DM+Sans:wght@300;400;500&display=swap');
|
| 321 |
|
| 322 |
-
[data-testid="stSidebar"]
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
footer { visibility: hidden; }
|
| 327 |
-
header { visibility: hidden; }
|
| 328 |
-
|
| 329 |
-
html, body { height: 100%; background: #120018 !important; }
|
| 330 |
|
|
|
|
|
|
|
|
|
|
| 331 |
.main .block-container {
|
| 332 |
padding: 0 !important;
|
| 333 |
margin: 0 !important;
|
| 334 |
max-width: 100% !important;
|
| 335 |
-
|
| 336 |
-
padding-right: 3rem !important;
|
| 337 |
-
padding-top: 0 !important;
|
| 338 |
-
padding-bottom: 0 !important;
|
| 339 |
-
min-height: 100vh;
|
| 340 |
-
display: flex;
|
| 341 |
-
flex-direction: column;
|
| 342 |
-
justify-content: center;
|
| 343 |
-
background: #120018;
|
| 344 |
-
box-sizing: border-box;
|
| 345 |
}
|
| 346 |
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 361 |
}
|
| 362 |
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 367 |
}
|
| 368 |
-
|
|
|
|
|
|
|
| 369 |
height: 48px !important;
|
| 370 |
border-radius: 10px !important;
|
| 371 |
-
border: 1.5px solid rgba(80,0,115,0.
|
| 372 |
background: rgba(255,255,255,0.05) !important;
|
| 373 |
color: #FDF5FF !important;
|
|
|
|
| 374 |
font-size: 14px !important;
|
|
|
|
|
|
|
|
|
|
| 375 |
}
|
| 376 |
-
|
| 377 |
border-color: #F67D31 !important;
|
| 378 |
box-shadow: 0 0 0 3px rgba(246,125,49,0.12) !important;
|
|
|
|
| 379 |
}
|
| 380 |
-
|
| 381 |
font-size: 11px !important;
|
| 382 |
font-weight: 500 !important;
|
| 383 |
letter-spacing: 0.05em !important;
|
| 384 |
text-transform: uppercase !important;
|
| 385 |
color: #FDF5FF !important;
|
|
|
|
| 386 |
}
|
| 387 |
-
div[data-testid="stForm"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 388 |
width: 100% !important;
|
| 389 |
height: 52px !important;
|
| 390 |
background: #500073 !important;
|
| 391 |
-
color:
|
| 392 |
border: none !important;
|
| 393 |
border-radius: 10px !important;
|
|
|
|
| 394 |
font-size: 15px !important;
|
| 395 |
font-weight: 500 !important;
|
| 396 |
letter-spacing: 0.03em !important;
|
| 397 |
margin-top: 0.5rem !important;
|
|
|
|
| 398 |
}
|
| 399 |
-
div[data-testid="stForm"] .stFormSubmitButton button:hover
|
|
|
|
| 400 |
background: #6b009a !important;
|
| 401 |
-
box-shadow: 0 0 18px rgba(246,125,49,0.2) !important;
|
| 402 |
}
|
| 403 |
.stButton > button {
|
| 404 |
width: 100% !important;
|
|
@@ -407,31 +497,43 @@ def render_login():
|
|
| 407 |
color: #FDF5FF !important;
|
| 408 |
border: 1.5px solid rgba(80,0,115,0.5) !important;
|
| 409 |
border-radius: 10px !important;
|
|
|
|
| 410 |
font-size: 14px !important;
|
| 411 |
font-weight: 400 !important;
|
| 412 |
}
|
| 413 |
.stButton > button:hover {
|
| 414 |
border-color: #F67D31 !important;
|
| 415 |
-
background: rgba(246,125,49,0.
|
| 416 |
-
box-shadow: none !important;
|
| 417 |
color: #FDF5FF !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 418 |
}
|
|
|
|
|
|
|
| 419 |
</style>
|
| 420 |
|
|
|
|
| 421 |
<div class="spjimr-brand-panel">
|
| 422 |
-
<
|
| 423 |
-
|
|
|
|
| 424 |
<path d="M10 500 Q50 290 90 70" stroke="#F67D31" stroke-width="28" stroke-linecap="round"/>
|
| 425 |
<path d="M65 500 Q115 290 155 50" stroke="#F67D31" stroke-width="22" stroke-linecap="round"/>
|
| 426 |
<path d="M125 500 Q185 300 225 40" stroke="#F67D31" stroke-width="16" stroke-linecap="round"/>
|
| 427 |
<path d="M190 500 Q248 320 292 70" stroke="#F67D31" stroke-width="10" stroke-linecap="round"/>
|
| 428 |
</svg>
|
| 429 |
<div style="position:absolute;bottom:0;left:0;width:400px;height:400px;
|
| 430 |
-
background:radial-gradient(ellipse at 20% 100%,rgba(246,125,49,0.
|
| 431 |
pointer-events:none;"></div>
|
|
|
|
|
|
|
| 432 |
<div style="position:relative;z-index:2;">
|
| 433 |
-
<div style="display:flex;align-items:
|
| 434 |
-
<svg width="
|
| 435 |
<path d="M5 54 Q10 35 18 15 Q22 4 28 0 Q23 15 30 23 Q32 11 40 3 Q38 19 42 27 Q46 36 42 46 Q38 54 30 54"
|
| 436 |
fill="none" stroke="#F67D31" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"/>
|
| 437 |
<path d="M9 54 Q14 37 22 22 Q26 11 32 5 Q28 19 34 27 Q36 17 42 9"
|
|
@@ -440,93 +542,123 @@ def render_login():
|
|
| 440 |
fill="none" stroke="#F67D31" stroke-width="2" stroke-linecap="round" opacity="0.35"/>
|
| 441 |
</svg>
|
| 442 |
<div>
|
| 443 |
-
<div style="font-family:'DM Sans',sans-serif;font-size:12px;
|
| 444 |
-
letter-spacing:0.05em;color:rgba(255,255,255,0.6);margin-bottom:
|
| 445 |
Bharatiya Vidya Bhavan's
|
| 446 |
</div>
|
| 447 |
-
<div style="font-family:'DM Sans',sans-serif;font-size:
|
| 448 |
-
|
|
|
|
| 449 |
</div>
|
| 450 |
</div>
|
| 451 |
</div>
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 456 |
</div>
|
| 457 |
-
<p style="font-family:'DM Sans',sans-serif;font-size:14px;font-weight:300;
|
| 458 |
-
line-height:1.75;color:rgba(255,255,255,0.5);max-width:340px;">
|
| 459 |
-
S.P. Jain Institute of Management and Research β shaping responsible leaders
|
| 460 |
-
for a complex world.
|
| 461 |
-
</p>
|
| 462 |
</div>
|
| 463 |
-
|
|
|
|
|
|
|
| 464 |
padding-top:1.8rem;border-top:1px solid rgba(255,255,255,0.1);">
|
| 465 |
<div>
|
| 466 |
-
<div style="font-family:'Cormorant Garamond',serif;font-size:1.9rem;
|
| 467 |
-
|
| 468 |
-
|
|
|
|
| 469 |
</div>
|
| 470 |
<div>
|
| 471 |
-
<div style="font-family:'Cormorant Garamond',serif;font-size:1.9rem;
|
| 472 |
-
|
| 473 |
-
|
|
|
|
| 474 |
</div>
|
| 475 |
<div>
|
| 476 |
-
<div style="font-family:'Cormorant Garamond',serif;font-size:1.
|
| 477 |
-
|
|
|
|
| 478 |
letter-spacing:0.06em;text-transform:uppercase;margin-top:3px;">Social impact</div>
|
| 479 |
</div>
|
| 480 |
</div>
|
| 481 |
</div>
|
|
|
|
|
|
|
|
|
|
| 482 |
""", unsafe_allow_html=True)
|
| 483 |
|
| 484 |
-
#
|
| 485 |
st.markdown("""
|
| 486 |
-
<div style="
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 501 |
</div>
|
| 502 |
""", unsafe_allow_html=True)
|
| 503 |
|
| 504 |
err_slot = st.empty()
|
| 505 |
|
| 506 |
with st.form("login_form", clear_on_submit=False):
|
| 507 |
-
email_val = st.text_input(
|
| 508 |
-
|
| 509 |
-
|
| 510 |
-
|
| 511 |
-
|
| 512 |
-
|
| 513 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 514 |
st.checkbox("Remember me", key="login_remember")
|
| 515 |
-
with
|
| 516 |
st.markdown(
|
| 517 |
'<div style="text-align:right;padding-top:6px;">'
|
| 518 |
-
'<a href="#" style="font-size:12px;color:#F67D31;
|
| 519 |
-
'Forgot password?</a></div>',
|
| 520 |
unsafe_allow_html=True,
|
| 521 |
)
|
| 522 |
-
submitted = st.form_submit_button("Sign in
|
| 523 |
|
| 524 |
if submitted:
|
| 525 |
_app_password = os.getenv("APP_PASSWORD")
|
| 526 |
if not _app_password:
|
| 527 |
-
err_slot.error(
|
|
|
|
|
|
|
|
|
|
| 528 |
elif not email_val or not email_val.lower().endswith("@spjimr.org"):
|
| 529 |
-
err_slot.error(
|
|
|
|
|
|
|
| 530 |
elif pass_val != _app_password:
|
| 531 |
err_slot.error("Incorrect password. Please try again.")
|
| 532 |
else:
|
|
@@ -537,19 +669,24 @@ def render_login():
|
|
| 537 |
st.markdown("""
|
| 538 |
<div style="display:flex;align-items:center;gap:12px;margin:1.2rem 0;">
|
| 539 |
<div style="flex:1;height:1px;background:rgba(80,0,115,0.4);"></div>
|
| 540 |
-
<span style="font-family:'DM Sans',sans-serif;font-size:12px;
|
|
|
|
| 541 |
<div style="flex:1;height:1px;background:rgba(80,0,115,0.4);"></div>
|
| 542 |
</div>
|
| 543 |
""", unsafe_allow_html=True)
|
| 544 |
|
| 545 |
-
if st.button(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 546 |
st.session_state["logged_in"] = True
|
| 547 |
st.session_state["login_user"] = "sso_user@spjimr.org"
|
| 548 |
st.rerun()
|
| 549 |
|
| 550 |
st.markdown("""
|
| 551 |
-
<div style="margin-top:1.
|
| 552 |
-
font-size:12px;color:rgba(196,164,212,0.
|
| 553 |
New to the platform?
|
| 554 |
<a href="#" style="color:#F67D31;text-decoration:none;font-weight:500;">Request access</a><br>
|
| 555 |
Having trouble?
|
|
@@ -558,9 +695,6 @@ def render_login():
|
|
| 558 |
""", unsafe_allow_html=True)
|
| 559 |
|
| 560 |
|
| 561 |
-
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 562 |
-
# Sidebar β shown only when logged in
|
| 563 |
-
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 564 |
|
| 565 |
def render_sidebar() -> str:
|
| 566 |
with st.sidebar:
|
|
|
|
| 313 |
|
| 314 |
|
| 315 |
def render_login():
|
| 316 |
+
"""SPJIMR login β fully responsive across desktop, tablet, mobile."""
|
| 317 |
|
| 318 |
st.markdown("""
|
| 319 |
<style>
|
| 320 |
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300&family=DM+Sans:wght@300;400;500&display=swap');
|
| 321 |
|
| 322 |
+
[data-testid="stSidebar"], [data-testid="stSidebarNav"] { display: none !important; }
|
| 323 |
+
.stDeployButton { display: none !important; }
|
| 324 |
+
#MainMenu, footer, header { visibility: hidden; }
|
| 325 |
+
html, body, [data-testid="stAppViewContainer"] { background: #120018 !important; }
|
|
|
|
|
|
|
|
|
|
|
|
|
| 326 |
|
| 327 |
+
/* Strip Streamlit padding everywhere */
|
| 328 |
+
[data-testid="stAppViewContainer"] > section.main,
|
| 329 |
+
[data-testid="stAppViewContainer"] > section.main > div,
|
| 330 |
.main .block-container {
|
| 331 |
padding: 0 !important;
|
| 332 |
margin: 0 !important;
|
| 333 |
max-width: 100% !important;
|
| 334 |
+
background: transparent !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 335 |
}
|
| 336 |
|
| 337 |
+
/* ββ DESKTOP β₯ 900px: fixed side-by-side split ββ */
|
| 338 |
+
@media (min-width: 900px) {
|
| 339 |
+
.spjimr-brand-panel {
|
| 340 |
+
position: fixed !important;
|
| 341 |
+
top: 0; left: 0;
|
| 342 |
+
width: 48%;
|
| 343 |
+
height: 100vh;
|
| 344 |
+
background: linear-gradient(160deg, #1C0029 0%, #0D0014 55%, #150008 100%);
|
| 345 |
+
border-right: 1px solid rgba(80,0,115,0.35);
|
| 346 |
+
display: flex !important;
|
| 347 |
+
flex-direction: column;
|
| 348 |
+
justify-content: space-between;
|
| 349 |
+
padding: clamp(2rem, 3.5vw, 3.5rem) clamp(1.5rem, 2.5vw, 3rem);
|
| 350 |
+
overflow: hidden;
|
| 351 |
+
z-index: 100;
|
| 352 |
+
box-sizing: border-box;
|
| 353 |
+
}
|
| 354 |
+
.spjimr-form-bg {
|
| 355 |
+
position: fixed !important;
|
| 356 |
+
top: 0; left: 48%;
|
| 357 |
+
width: 52%;
|
| 358 |
+
height: 100vh;
|
| 359 |
+
background: #120018;
|
| 360 |
+
z-index: 100;
|
| 361 |
+
pointer-events: none;
|
| 362 |
+
}
|
| 363 |
+
.main .block-container {
|
| 364 |
+
position: relative;
|
| 365 |
+
z-index: 300 !important;
|
| 366 |
+
padding-left: calc(48% + 3rem) !important;
|
| 367 |
+
padding-right: 3rem !important;
|
| 368 |
+
padding-top: 0 !important;
|
| 369 |
+
padding-bottom: 0 !important;
|
| 370 |
+
width: 100% !important;
|
| 371 |
+
min-height: 100vh;
|
| 372 |
+
display: flex !important;
|
| 373 |
+
flex-direction: column !important;
|
| 374 |
+
justify-content: center !important;
|
| 375 |
+
box-sizing: border-box !important;
|
| 376 |
+
}
|
| 377 |
+
.main .block-container > div:first-child {
|
| 378 |
+
max-width: 420px !important;
|
| 379 |
+
}
|
| 380 |
+
.brand-tagline, .brand-desc, .brand-stats { display: block !important; }
|
| 381 |
}
|
| 382 |
|
| 383 |
+
/* ββ TABLET 600β899px: top logo bar, form below ββ */
|
| 384 |
+
@media (min-width: 600px) and (max-width: 899px) {
|
| 385 |
+
.spjimr-brand-panel {
|
| 386 |
+
position: relative !important;
|
| 387 |
+
width: 100% !important;
|
| 388 |
+
height: auto !important;
|
| 389 |
+
background: linear-gradient(160deg, #1C0029 0%, #0D0014 100%);
|
| 390 |
+
border-bottom: 1px solid rgba(80,0,115,0.35);
|
| 391 |
+
display: flex !important;
|
| 392 |
+
flex-direction: row;
|
| 393 |
+
align-items: center;
|
| 394 |
+
padding: 1.2rem 2rem !important;
|
| 395 |
+
gap: 1.2rem;
|
| 396 |
+
box-sizing: border-box;
|
| 397 |
+
z-index: 10;
|
| 398 |
+
}
|
| 399 |
+
.spjimr-form-bg { display: none !important; }
|
| 400 |
+
.brand-tagline, .brand-desc, .brand-stats { display: none !important; }
|
| 401 |
+
.main .block-container {
|
| 402 |
+
position: relative !important;
|
| 403 |
+
z-index: 10 !important;
|
| 404 |
+
padding: 2.5rem 3rem !important;
|
| 405 |
+
max-width: 560px !important;
|
| 406 |
+
margin: 0 auto !important;
|
| 407 |
+
width: 100% !important;
|
| 408 |
+
box-sizing: border-box !important;
|
| 409 |
+
}
|
| 410 |
+
.main .block-container > div:first-child { max-width: 100% !important; }
|
| 411 |
+
}
|
| 412 |
+
|
| 413 |
+
/* ββ MOBILE < 600px: compact logo strip, full-width form ββ */
|
| 414 |
+
@media (max-width: 599px) {
|
| 415 |
+
.spjimr-brand-panel {
|
| 416 |
+
position: relative !important;
|
| 417 |
+
width: 100% !important;
|
| 418 |
+
height: auto !important;
|
| 419 |
+
background: linear-gradient(160deg, #1C0029 0%, #0D0014 100%);
|
| 420 |
+
border-bottom: 1px solid rgba(80,0,115,0.35);
|
| 421 |
+
display: flex !important;
|
| 422 |
+
flex-direction: row;
|
| 423 |
+
align-items: center;
|
| 424 |
+
padding: 0.9rem 1.2rem !important;
|
| 425 |
+
gap: 0.9rem;
|
| 426 |
+
box-sizing: border-box;
|
| 427 |
+
z-index: 10;
|
| 428 |
+
}
|
| 429 |
+
.spjimr-form-bg { display: none !important; }
|
| 430 |
+
.brand-tagline, .brand-desc, .brand-stats { display: none !important; }
|
| 431 |
+
.main .block-container {
|
| 432 |
+
position: relative !important;
|
| 433 |
+
z-index: 10 !important;
|
| 434 |
+
padding: 1.5rem 1.2rem 2rem !important;
|
| 435 |
+
max-width: 100% !important;
|
| 436 |
+
width: 100% !important;
|
| 437 |
+
box-sizing: border-box !important;
|
| 438 |
+
}
|
| 439 |
+
.main .block-container > div:first-child { max-width: 100% !important; }
|
| 440 |
}
|
| 441 |
+
|
| 442 |
+
/* ββ Form inputs (all breakpoints) ββ */
|
| 443 |
+
.stTextInput > div > div > input {
|
| 444 |
height: 48px !important;
|
| 445 |
border-radius: 10px !important;
|
| 446 |
+
border: 1.5px solid rgba(80,0,115,0.55) !important;
|
| 447 |
background: rgba(255,255,255,0.05) !important;
|
| 448 |
color: #FDF5FF !important;
|
| 449 |
+
font-family: 'DM Sans', sans-serif !important;
|
| 450 |
font-size: 14px !important;
|
| 451 |
+
padding: 0 16px !important;
|
| 452 |
+
width: 100% !important;
|
| 453 |
+
box-sizing: border-box !important;
|
| 454 |
}
|
| 455 |
+
.stTextInput > div > div > input:focus {
|
| 456 |
border-color: #F67D31 !important;
|
| 457 |
box-shadow: 0 0 0 3px rgba(246,125,49,0.12) !important;
|
| 458 |
+
outline: none !important;
|
| 459 |
}
|
| 460 |
+
.stTextInput > label p, .stTextInput label {
|
| 461 |
font-size: 11px !important;
|
| 462 |
font-weight: 500 !important;
|
| 463 |
letter-spacing: 0.05em !important;
|
| 464 |
text-transform: uppercase !important;
|
| 465 |
color: #FDF5FF !important;
|
| 466 |
+
font-family: 'DM Sans', sans-serif !important;
|
| 467 |
}
|
| 468 |
+
div[data-testid="stForm"] {
|
| 469 |
+
background: transparent !important;
|
| 470 |
+
border: none !important;
|
| 471 |
+
padding: 0 !important;
|
| 472 |
+
width: 100% !important;
|
| 473 |
+
}
|
| 474 |
+
div[data-testid="stForm"] .stFormSubmitButton > button,
|
| 475 |
+
div[data-testid="stFormSubmitButton"] > button {
|
| 476 |
width: 100% !important;
|
| 477 |
height: 52px !important;
|
| 478 |
background: #500073 !important;
|
| 479 |
+
color: #fff !important;
|
| 480 |
border: none !important;
|
| 481 |
border-radius: 10px !important;
|
| 482 |
+
font-family: 'DM Sans', sans-serif !important;
|
| 483 |
font-size: 15px !important;
|
| 484 |
font-weight: 500 !important;
|
| 485 |
letter-spacing: 0.03em !important;
|
| 486 |
margin-top: 0.5rem !important;
|
| 487 |
+
cursor: pointer !important;
|
| 488 |
}
|
| 489 |
+
div[data-testid="stForm"] .stFormSubmitButton > button:hover,
|
| 490 |
+
div[data-testid="stFormSubmitButton"] > button:hover {
|
| 491 |
background: #6b009a !important;
|
|
|
|
| 492 |
}
|
| 493 |
.stButton > button {
|
| 494 |
width: 100% !important;
|
|
|
|
| 497 |
color: #FDF5FF !important;
|
| 498 |
border: 1.5px solid rgba(80,0,115,0.5) !important;
|
| 499 |
border-radius: 10px !important;
|
| 500 |
+
font-family: 'DM Sans', sans-serif !important;
|
| 501 |
font-size: 14px !important;
|
| 502 |
font-weight: 400 !important;
|
| 503 |
}
|
| 504 |
.stButton > button:hover {
|
| 505 |
border-color: #F67D31 !important;
|
| 506 |
+
background: rgba(246,125,49,0.07) !important;
|
|
|
|
| 507 |
color: #FDF5FF !important;
|
| 508 |
+
box-shadow: none !important;
|
| 509 |
+
}
|
| 510 |
+
.stCheckbox label p {
|
| 511 |
+
color: #C4A4D4 !important;
|
| 512 |
+
font-size: 13px !important;
|
| 513 |
+
font-family: 'DM Sans', sans-serif !important;
|
| 514 |
}
|
| 515 |
+
.stCheckbox input[type="checkbox"] { accent-color: #F67D31 !important; }
|
| 516 |
+
.stAlert { border-radius: 8px !important; }
|
| 517 |
</style>
|
| 518 |
|
| 519 |
+
<!-- Brand panel: full on desktop, compact header on tablet/mobile -->
|
| 520 |
<div class="spjimr-brand-panel">
|
| 521 |
+
<!-- Decorative SVG flames (desktop only, hidden via CSS on small screens) -->
|
| 522 |
+
<svg style="position:absolute;bottom:-40px;left:-10px;width:320px;height:500px;
|
| 523 |
+
opacity:0.07;pointer-events:none;" viewBox="0 0 320 500" fill="none">
|
| 524 |
<path d="M10 500 Q50 290 90 70" stroke="#F67D31" stroke-width="28" stroke-linecap="round"/>
|
| 525 |
<path d="M65 500 Q115 290 155 50" stroke="#F67D31" stroke-width="22" stroke-linecap="round"/>
|
| 526 |
<path d="M125 500 Q185 300 225 40" stroke="#F67D31" stroke-width="16" stroke-linecap="round"/>
|
| 527 |
<path d="M190 500 Q248 320 292 70" stroke="#F67D31" stroke-width="10" stroke-linecap="round"/>
|
| 528 |
</svg>
|
| 529 |
<div style="position:absolute;bottom:0;left:0;width:400px;height:400px;
|
| 530 |
+
background:radial-gradient(ellipse at 20% 100%,rgba(246,125,49,0.13) 0%,transparent 60%);
|
| 531 |
pointer-events:none;"></div>
|
| 532 |
+
|
| 533 |
+
<!-- Logo: always visible -->
|
| 534 |
<div style="position:relative;z-index:2;">
|
| 535 |
+
<div style="display:flex;align-items:center;gap:14px;flex-shrink:0;">
|
| 536 |
+
<svg width="clamp(28px,3vw,40px)" height="clamp(34px,3.5vw,48px)" viewBox="0 0 46 54" fill="none">
|
| 537 |
<path d="M5 54 Q10 35 18 15 Q22 4 28 0 Q23 15 30 23 Q32 11 40 3 Q38 19 42 27 Q46 36 42 46 Q38 54 30 54"
|
| 538 |
fill="none" stroke="#F67D31" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"/>
|
| 539 |
<path d="M9 54 Q14 37 22 22 Q26 11 32 5 Q28 19 34 27 Q36 17 42 9"
|
|
|
|
| 542 |
fill="none" stroke="#F67D31" stroke-width="2" stroke-linecap="round" opacity="0.35"/>
|
| 543 |
</svg>
|
| 544 |
<div>
|
| 545 |
+
<div style="font-family:'DM Sans',sans-serif;font-size:clamp(10px,1vw,12px);
|
| 546 |
+
font-weight:300;letter-spacing:0.05em;color:rgba(255,255,255,0.6);margin-bottom:2px;">
|
| 547 |
Bharatiya Vidya Bhavan's
|
| 548 |
</div>
|
| 549 |
+
<div style="font-family:'DM Sans',sans-serif;font-size:clamp(20px,2.5vw,30px);
|
| 550 |
+
font-weight:500;line-height:1;">
|
| 551 |
+
<span style="color:#F67D31;">SP</span><span style="color:#fff;">JIMR</span>
|
| 552 |
</div>
|
| 553 |
</div>
|
| 554 |
</div>
|
| 555 |
+
|
| 556 |
+
<!-- Headline: desktop only -->
|
| 557 |
+
<div class="brand-tagline" style="margin-top:2.5rem;">
|
| 558 |
+
<div style="font-family:'Cormorant Garamond',serif;
|
| 559 |
+
font-size:clamp(1.6rem,2.5vw,2.8rem);
|
| 560 |
+
font-weight:300;line-height:1.12;color:white;margin-bottom:1rem;">
|
| 561 |
+
Where <em style="font-style:italic;color:#FFA066;">purpose</em><br>
|
| 562 |
+
meets<br>management.
|
| 563 |
+
</div>
|
| 564 |
+
<p class="brand-desc" style="font-family:'DM Sans',sans-serif;
|
| 565 |
+
font-size:clamp(12px,1.1vw,14px);font-weight:300;
|
| 566 |
+
line-height:1.75;color:rgba(255,255,255,0.48);max-width:320px;margin:0;">
|
| 567 |
+
S.P. Jain Institute of Management and Research β shaping responsible
|
| 568 |
+
leaders for a complex world.
|
| 569 |
+
</p>
|
| 570 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 571 |
</div>
|
| 572 |
+
|
| 573 |
+
<!-- Stats: desktop only -->
|
| 574 |
+
<div class="brand-stats" style="position:relative;z-index:2;display:flex;gap:2rem;
|
| 575 |
padding-top:1.8rem;border-top:1px solid rgba(255,255,255,0.1);">
|
| 576 |
<div>
|
| 577 |
+
<div style="font-family:'Cormorant Garamond',serif;font-size:clamp(1.3rem,1.8vw,1.9rem);
|
| 578 |
+
font-weight:600;color:#F67D31;line-height:1;">62+</div>
|
| 579 |
+
<div style="font-family:'DM Sans',sans-serif;font-size:10px;color:rgba(255,255,255,0.38);
|
| 580 |
+
letter-spacing:0.06em;text-transform:uppercase;margin-top:3px;">Years</div>
|
| 581 |
</div>
|
| 582 |
<div>
|
| 583 |
+
<div style="font-family:'Cormorant Garamond',serif;font-size:clamp(1.3rem,1.8vw,1.9rem);
|
| 584 |
+
font-weight:600;color:#F67D31;line-height:1;">10K+</div>
|
| 585 |
+
<div style="font-family:'DM Sans',sans-serif;font-size:10px;color:rgba(255,255,255,0.38);
|
| 586 |
+
letter-spacing:0.06em;text-transform:uppercase;margin-top:3px;">Alumni</div>
|
| 587 |
</div>
|
| 588 |
<div>
|
| 589 |
+
<div style="font-family:'Cormorant Garamond',serif;font-size:clamp(1.3rem,1.8vw,1.9rem);
|
| 590 |
+
font-weight:600;color:#F67D31;line-height:1;">#1</div>
|
| 591 |
+
<div style="font-family:'DM Sans',sans-serif;font-size:10px;color:rgba(255,255,255,0.38);
|
| 592 |
letter-spacing:0.06em;text-transform:uppercase;margin-top:3px;">Social impact</div>
|
| 593 |
</div>
|
| 594 |
</div>
|
| 595 |
</div>
|
| 596 |
+
|
| 597 |
+
<!-- Right panel bg: desktop only -->
|
| 598 |
+
<div class="spjimr-form-bg"></div>
|
| 599 |
""", unsafe_allow_html=True)
|
| 600 |
|
| 601 |
+
# ββ Form heading ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 602 |
st.markdown("""
|
| 603 |
+
<div style="margin-bottom:1.4rem;">
|
| 604 |
+
<div style="display:inline-flex;align-items:center;gap:6px;
|
| 605 |
+
background:rgba(246,125,49,0.12);color:#F67D31;
|
| 606 |
+
font-family:'DM Sans',sans-serif;font-size:11px;font-weight:500;
|
| 607 |
+
letter-spacing:0.05em;text-transform:uppercase;
|
| 608 |
+
padding:5px 14px;border-radius:100px;margin-bottom:0.9rem;">
|
| 609 |
+
<span style="width:6px;height:6px;border-radius:50%;background:#F67D31;
|
| 610 |
+
display:inline-block;flex-shrink:0;"></span>
|
| 611 |
+
ESG Sustainability Platform
|
| 612 |
+
</div>
|
| 613 |
+
<div style="font-family:'Cormorant Garamond',serif;
|
| 614 |
+
font-size:clamp(1.5rem,3vw,1.9rem);
|
| 615 |
+
font-weight:400;color:#fff;line-height:1.15;margin-bottom:0.3rem;">
|
| 616 |
+
Welcome back
|
| 617 |
+
</div>
|
| 618 |
+
<div style="font-family:'DM Sans',sans-serif;font-size:clamp(12px,1.5vw,13px);
|
| 619 |
+
color:rgba(196,164,212,0.85);font-weight:300;line-height:1.6;">
|
| 620 |
+
Sign in with your SPJIMR email to continue.
|
| 621 |
+
</div>
|
| 622 |
</div>
|
| 623 |
""", unsafe_allow_html=True)
|
| 624 |
|
| 625 |
err_slot = st.empty()
|
| 626 |
|
| 627 |
with st.form("login_form", clear_on_submit=False):
|
| 628 |
+
email_val = st.text_input(
|
| 629 |
+
"Email address",
|
| 630 |
+
placeholder="yourname@spjimr.org",
|
| 631 |
+
key="login_email_input",
|
| 632 |
+
)
|
| 633 |
+
pass_val = st.text_input(
|
| 634 |
+
"Password",
|
| 635 |
+
type="password",
|
| 636 |
+
placeholder="Enter your password",
|
| 637 |
+
key="login_pass_input",
|
| 638 |
+
)
|
| 639 |
+
col_r, col_f = st.columns([1, 1])
|
| 640 |
+
with col_r:
|
| 641 |
st.checkbox("Remember me", key="login_remember")
|
| 642 |
+
with col_f:
|
| 643 |
st.markdown(
|
| 644 |
'<div style="text-align:right;padding-top:6px;">'
|
| 645 |
+
'<a href="#" style="font-size:12px;color:#F67D31;'
|
| 646 |
+
'text-decoration:none;font-weight:500;">Forgot password?</a></div>',
|
| 647 |
unsafe_allow_html=True,
|
| 648 |
)
|
| 649 |
+
submitted = st.form_submit_button("Sign in \u2192")
|
| 650 |
|
| 651 |
if submitted:
|
| 652 |
_app_password = os.getenv("APP_PASSWORD")
|
| 653 |
if not _app_password:
|
| 654 |
+
err_slot.error(
|
| 655 |
+
"\u2699\ufe0f APP_PASSWORD secret is not set. "
|
| 656 |
+
"Add it in HuggingFace Space settings."
|
| 657 |
+
)
|
| 658 |
elif not email_val or not email_val.lower().endswith("@spjimr.org"):
|
| 659 |
+
err_slot.error(
|
| 660 |
+
"Access restricted to SPJIMR email addresses (@spjimr.org)."
|
| 661 |
+
)
|
| 662 |
elif pass_val != _app_password:
|
| 663 |
err_slot.error("Incorrect password. Please try again.")
|
| 664 |
else:
|
|
|
|
| 669 |
st.markdown("""
|
| 670 |
<div style="display:flex;align-items:center;gap:12px;margin:1.2rem 0;">
|
| 671 |
<div style="flex:1;height:1px;background:rgba(80,0,115,0.4);"></div>
|
| 672 |
+
<span style="font-family:'DM Sans',sans-serif;font-size:12px;
|
| 673 |
+
color:rgba(196,164,212,0.45);">or continue with</span>
|
| 674 |
<div style="flex:1;height:1px;background:rgba(80,0,115,0.4);"></div>
|
| 675 |
</div>
|
| 676 |
""", unsafe_allow_html=True)
|
| 677 |
|
| 678 |
+
if st.button(
|
| 679 |
+
"\U0001f510 SPJIMR Single Sign-On (SSO)",
|
| 680 |
+
use_container_width=True,
|
| 681 |
+
key="sso_btn",
|
| 682 |
+
):
|
| 683 |
st.session_state["logged_in"] = True
|
| 684 |
st.session_state["login_user"] = "sso_user@spjimr.org"
|
| 685 |
st.rerun()
|
| 686 |
|
| 687 |
st.markdown("""
|
| 688 |
+
<div style="margin-top:1.4rem;text-align:center;font-family:'DM Sans',sans-serif;
|
| 689 |
+
font-size:12px;color:rgba(196,164,212,0.45);line-height:1.9;">
|
| 690 |
New to the platform?
|
| 691 |
<a href="#" style="color:#F67D31;text-decoration:none;font-weight:500;">Request access</a><br>
|
| 692 |
Having trouble?
|
|
|
|
| 695 |
""", unsafe_allow_html=True)
|
| 696 |
|
| 697 |
|
|
|
|
|
|
|
|
|
|
| 698 |
|
| 699 |
def render_sidebar() -> str:
|
| 700 |
with st.sidebar:
|