/*
 * Login Modal and User Options Styles
 * Extracted from style.css and style-kvp.css for better modularity
 * Used by: KVP_login_js.js
 *
 * ⚠️ IMPORTANT: SHARED WITH READING ROOM ⚠️
 *
 * This CSS file mirrors login-related styles that are also used in the
 * Khyentse Vision Project Reading Room application. Any changes made to
 * this file should be carefully coordinated with corresponding changes
 * in the Reading Room codebase.
 *
 * DO NOT modify these styles independently without considering the impact
 * on the Reading Room. The login modal, user options menu, and authentication
 * UI components are shared between both applications.
 *
 * When making changes:
 * 1. Test changes in BOTH WordPress theme and Reading Room
 * 2. Ensure visual consistency across both applications
 * 3. Update Reading Room styles accordingly
 * 4. Document any breaking changes
 */


/* ========================================
   USER OPTIONS ROLLOUT MENU
   ======================================== */

#user-options-rollout{
  position:absolute;
  top:64px;
  right:0;
  background:#e1e6e6;
  padding:16px;
  z-index:1000;
  width:180px;
  height:120px;
  line-height:normal;
}
.user-options-rollout-close{
  display:flex;
  justify-content:flex-end;
  line-height:normal;
}
.user-options-rollout-menu{
  color:#494951;
  padding:0 !important;
  line-height:normal;
}
.user-options-rollout-menu-item{
  list-style-type:none;
  cursor:pointer;
  line-height:normal;
}
.user-options-rollout-logout-link{
  color:#494951 !important;
  line-height:normal;
}

/* ========================================
   USER LOGIN STATE INDICATORS
   ======================================== */

#login-icon{
  font-size:27px;
  line-height:normal;
}

/* User Logged In Badge (Desktop) */
.user-logged-in-disc{
  height:28px;
  width:28px;
  border-radius:14px;
  background:#0f4f70;
  color:#fff;
  font-size:16px;
  font-weight:500;
  line-height:28px;
  text-align:center;
}

/* User Logged In Badge (Mobile) */
.mobile-user-logged-in-disc{
  all:unset;
  background-color:#0f4b70;
  height:24px;
  width:24px;
  border-radius:12px;
  color:white;
  font-size:14px;
  display:inline-block;
  text-align:center;
  line-height:24px;
  position:relative;
  top:4px;
  margin-left:8px;
}

/* ========================================
   LOGIN MODAL STRUCTURE
   ======================================== */

#login-modal{
  height:100%;
  width:100%;
  position:absolute;
  top:64px;
  right:0;
  z-index:10000;
  background:rgba(0,0,0,0.2);
  line-height:0;
}

.modal-form-wrapper{
  box-sizing: content-box;
  font-weight: 400;
  width: 448px;
  position: absolute;
  top: 0;
  right: 0;
  background:  #E1E6E6;
  font-family: "Minion3-Regular";
  font-size: 19px;
  border: 1px solid #eee;
  border-top: 3px solid #c8960c; /* WP variant indicator — amber; Next.js uses teal #0c9cb2 */
  padding: 32px;
  padding-top: 10px;
  padding-right: 15px;
  line-height: 0;
}

.modal-form-wrapper::after {
  content: attr(data-kvp-login-version);
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 9px;
  font-family: monospace;
  color: #b0b8b8;
  line-height: normal;
  pointer-events: none;
}

.close-modal{
  position: absolute;
  top: 10px;
  right: 15px;
  background:none;
  border:none;
  padding:0;
  cursor:pointer;
  font-family:inherit;
  width:20px;
  height:20px;
  line-height:normal;
  font-size:20px;
  z-index: 1;
}

/* ----------------------------------------
   ADDED FROM MAIN BRANCH (Mar 2026)
   These selectors were in style.css on main but were not in the
   side-branch version of style-kvp-login.css because they were
   added after that branch diverged. Moved here during manual
   reconciliation so they live with the rest of the login styles.
   ---------------------------------------- */
.close-modal-icon{
  width:20px;
  height:20px;
  color:#808080;
  display:block;
}

.modal-form-header{
  margin-top:12px;
  margin-bottom:0;
  line-height:normal;
  text-align:left;
}

form#password-login-section{
  margin: 0;
  padding: 0;
  border: none;
  margin-bottom: 0 !important;
  margin-block-end: 0 !important;
  line-height: normal;
  gap: 0 !important;
}

/* ========================================
   GOOGLE OAUTH LOGIN SECTION
   ⚠️ Shared with Reading Room
   ======================================== */

.google-login{
  width: 100%;
  text-align: center;
  margin-top: 41px;
  margin-bottom: 0;
  font-size: 20px;
  line-height: 30px;
}

/* "OR" divider paragraph */
.google-login p{
  margin: 0;
  line-height: normal;
}

#google-login-subtitle{
  font-size: 19px !important;
  font-style: italic;
  text-align: left;
  margin: 4px 0 0;
  line-height: normal;
}

/* ========================================
   LOGIN FORM INPUTS
   ⚠️ Shared with Reading Room
   ======================================== */

form#password-login-section .login-label,
.login-label{
  display: block;
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 16px;
  margin-left: 16px;
  clip: auto;
  height: auto;
  overflow: visible;
  position: static;
  width: auto;
  line-height: normal;
}

.login-input{
  height:27px;
  width:calc(100% - 16px);
  margin-left:16px;
  border:1px solid #ccc;
  font-family:"Minion3-Regular";
  text-transform:unset;
  font-size:16px !important;
  font-weight:400 !important;
  margin-top:0;
  margin-bottom:0;
  padding:2px 6px !important;
  box-sizing:border-box;
  line-height: normal;
}

.password-input-div{
  white-space: nowrap;
  line-height: normal;
}

/* ========================================
   ERROR MESSAGES
   ⚠️ Shared with Reading Room
   ======================================== */

.sign-in-error {
  font-size: 12px;           /* Slightly larger for readability */
  color: #B20000;
  opacity: 0;                /* Start hidden */
  margin-left: 16px;
  line-height: 1.4;          /* Give text plenty of vertical room */
  height: 18px;              /* Explicit height to hold the text */
  margin-top: 0;
  margin-bottom: 8px;        /* Push the next label away */
  transition: opacity 0.2s;  /* Smooth fade in */
}

/* This is the key: when the JS sets visibility, we also set opacity */
.sign-in-error[style*="visible"] {
  opacity: 1 !important;
}

/* ----------------------------------------
   ADDED FROM MAIN BRANCH (Mar 2026)
   #password-errors existed in style.css on main but not in the
   side-branch version of this file. Moved here during manual
   reconciliation.
   ---------------------------------------- */
#password-errors{
  margin-top:-16px;
}

#general-sign-in-error {
  font-size: 13px;
  color: #B20000;
  line-height: normal;
  margin-top: 10px;
  height: auto;              /* General errors can be multi-line */
  opacity: 1;                /* Usually shown immediately upon error */
}
/* ========================================
   PASSWORD VISIBILITY TOGGLE
   ⚠️ Shared with Reading Room
   ======================================== */

button#toggle-password {
  background: none;
  border:none;
  width:44px !important;
  cursor: pointer;
  font-size: var(--mobile-font-size);
  font-weight: 300;
  padding: 0;
  color:#000 !important;
  display:inline-block  !important;
  position:relative;
  left:-40px;
  line-height:normal;
}

button#toggle-password i {
  color:#808080 !important;
  line-height:normal;
}

/* ========================================
   FORM BUTTONS
   ⚠️ Shared with Reading Room
   ======================================== */

.modal-submit-button{
  display: block;
  background: #2E6085;
  height: 42px;
  padding: 8px 16px 8px 16px;
  color: white;
  font-size: 20px;
  font-weight: 400;
  text-align: center;
  border: unset;
  font-family: "MinionPro-Regular";
  cursor: pointer;
  margin-left: auto;
  margin-right: auto;
  margin-top: 8px;
  margin-bottom: 0px;
  line-height:normal;
  text-transform: none;
  width: auto;
  max-width: fit-content;
}

/* ========================================
   PASSWORD RESET & SIGN UP LINKS
   ⚠️ Shared with Reading Room
   ======================================== */

.forgot-password-link{
  display:block;
  text-decoration:none !important;
  border:unset !important;
  color:#2E6085 !important;
  font-family:Arial, Helvetica, sans-serif !important;
  font-size:12px !important;
  cursor:pointer;
  width:100%;
  text-align:left;
  margin-top:-15px;
  margin-left:16px;
  line-height:normal;
  text-transform: none;
}

.sign-up-link-wrapper{
  display: block;
  text-decoration: none !important;
  border: unset !important;
  color: #000;
  font-family: "Minion3-Regular";
  font-size: 16px !important;
  margin-top: 12px;
  margin-bottom: 0;
  width: 100%;
  text-align: center;
  line-height:normal;
}

/* ----------------------------------------
   ADDED FROM MAIN BRANCH (Mar 2026)
   .sign-up-link existed in style.css on main but not in the
   side-branch version of this file. Moved here during manual
   reconciliation.
   ---------------------------------------- */
.sign-up-link{
  text-decoration:underline;
}

/* reCAPTCHA advisory text */
.recaptcha-advisory,
.modal-form-wrapper > div[style*="text-align:right"][style*="font-size:11px"]{
  margin-top: 16px !important;
  margin-bottom: 0 !important;
  line-height: normal !important;
  order: 999 !important; /* Push to bottom when flex layout */
}

/* Ensure modal wrapper uses flexbox to control child order */
.modal-form-wrapper {
  display: flex;
  flex-direction: column;
}

/* Set order for all major sections to maintain layout */
/* Note: .close-modal uses absolute positioning, doesn't need order */

#google-login-section {
  order: 2;
}

#password-login-section {
  order: 3;
}

.sign-up-link-wrapper {
  order: 4;
}

/* Password reset section should appear in normal flow */
#password-reset-section {
  order: 5;
}

#general-sign-in-error {
  order: 6;
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ⚠️ Shared with Reading Room - test changes on mobile!
   ======================================== */

@media(max-width:1023px){
  .modal-form-wrapper{
    width:90vw;
    top:60px;
    right:5vw;
    padding:16px;
  }
  .login-input{
    width:90%;
  }
  #toggle-password{
    left:83% !important;
  }
  .forgot-password-link{
    margin-top:0;
  }
}
