/* ==========================================================
   Auth Forms (Register / Login) — CitySwim
   Uses the same design tokens defined in :root inside style.css
   ========================================================== */

.auth-section{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:calc(100vh - 320px);
  padding:56px 20px;
}

.auth-card{
  width:100%;
  max-width:440px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:24px;
  padding:40px 36px;
  box-shadow:var(--shadow-soft);
  position:relative;
  overflow:hidden;
}

.auth-card::before{
  content:'';
  position:absolute;
  top:0; right:0; left:0;
  height:6px;
  background:var(--gradient-brand);
}

.auth-head{
  text-align:center;
  margin-bottom:28px;
}

.auth-head h2{
  font-size:1.5rem;
  font-weight:800;
  color:var(--ink);
  margin-bottom:8px;
}

.auth-head p{
  color:var(--ink-muted);
  font-size:0.92rem;
}

/* Django's {{ form.as_p }} wraps each field in <p> tags */
.auth-card form p{
  margin-bottom:18px;
}

.auth-card form label{
  display:block;
  font-size:0.88rem;
  font-weight:600;
  margin-bottom:7px;
  color:var(--ink);
}

.auth-card form input,
.auth-card form select,
.auth-card form textarea{
  width:100%;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--bg);
  font-family:inherit;
  font-size:0.95rem;
  color:var(--ink);
  transition:border-color .2s, box-shadow .2s;
}

.auth-card form textarea{
  min-height:100px;
  resize:vertical;
}

.auth-card form input:focus,
.auth-card form select:focus,
.auth-card form textarea:focus{
  border-color:var(--purple-2);
  box-shadow:0 0 0 3px rgba(155,127,232,0.18);
  outline:none;
}

/* Django form field help text / errors */
.auth-card form small,
.auth-card form .helptext{
  display:block;
  margin-top:6px;
  font-size:0.78rem;
  color:var(--ink-muted);
}

.auth-card form ul.errorlist{
  list-style:none;
  margin:6px 0 0;
  padding:0;
}

.auth-card form ul.errorlist li{
  color:#C0392B;
  font-size:0.82rem;
  font-weight:600;
  margin-top:4px;
}

.auth-card form button[type="submit"]{
  width:100%;
  background:var(--purple-2);
  color:#fff;
  padding:14px;
  border-radius:12px;
  font-weight:700;
  font-size:1rem;
  margin-top:8px;
  box-shadow:var(--shadow-soft);
  transition:transform .2s;
}

.auth-card form button[type="submit"]:hover{
  transform:translateY(-2px);
}

.auth-switch{
  text-align:center;
  margin-top:20px;
  font-size:0.9rem;
  color:var(--ink-muted);
}

.auth-switch a{
  color:var(--purple-1);
  font-weight:700;
}

.auth-switch a:hover{
  text-decoration:underline;
}

.link-button{
  background:none;
  border:none;
  padding:0;
  font:inherit;
  color:var(--purple-1);
  font-weight:700;
  cursor:pointer;
}

.link-button:hover{
  text-decoration:underline;
}

@media (max-width:480px){
  .auth-card{
    padding:30px 22px;
    border-radius:18px;
  }
}

/* ==========================================================
   Profile View — CitySwim
   ========================================================== */

.profile-section{
  padding:56px 20px;
}

.profile-card{
  max-width:560px;
  margin:0 auto;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:24px;
  box-shadow:var(--shadow-soft);
  overflow:hidden;
}

.profile-banner{
  background:var(--gradient-brand);
  padding:36px 32px 60px;
  text-align:center;
  position:relative;
}

.profile-info{
  padding:32px 32px 8px;
  margin-top:-32px;
  background:var(--surface);
  border-radius:24px 24px 0 0;
  position:relative;
}

.profile-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 0;
  border-bottom:1px solid var(--line);
}

.profile-row:last-child{
  border-bottom:none;
}

.profile-row-label{
  font-size:0.85rem;
  font-weight:600;
  color:var(--ink-muted);
  white-space:nowrap;
}

.profile-row-value{
  font-size:0.95rem;
  font-weight:600;
  color:var(--ink);
  text-align:left;
  overflow-wrap:anywhere;
}

.profile-actions{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:12px;
  padding:24px 32px 32px;
}

.profile-actions-group{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:12px;
  width:100%;
}

.profile-actions .btn-primary{
  display:flex;
  justify-content:center;
  align-items:center;
  width:220px;
  min-height:48px;
  box-sizing:border-box;
}

.profile-btn-logout{
  position: relative;
  top: 25px;
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1.5px solid var(--line);
  border-radius:100px;
  padding:11px 20px;
  font-weight:600;
  font-size:0.92rem;
  color:var(--ink);
  transition:background .2s, border-color .2s;
}

.profile-btn-logout:hover{
  background:var(--surface-alt);
  border-color:#a81909;
  color:#a81909;
}

/* Logout Modal */

.logout-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);

    display: none;
    align-items: center;
    justify-content: center;

    z-index: 9999;

    padding: 20px;
}

.logout-modal.active {
    display: flex;
}

.logout-modal-box {
    position: relative;

    width: 100%;
    max-width: 420px;

    background: #ffffff;
    border-radius: 20px;

    padding: 30px;

    text-align: center;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);

    animation: logoutModalShow 0.2s ease;
}

@keyframes logoutModalShow {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.logout-modal-close {
    position: absolute;

    top: 12px;
    left: 15px;

    width: 32px;
    height: 32px;

    border: none;
    background: transparent;

    font-size: 28px;
    line-height: 1;

    cursor: pointer;

    color: #777;
}

.logout-modal-close:hover {
    color: #222;
}

.logout-modal-icon {
    width: 60px;
    height: 60px;

    margin: 0 auto 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--surface-alt);
    color: var(--purple-1);

    font-size: 30px;
    font-weight: bold;
}

.logout-modal-box h3 {
    margin: 0 0 10px;

    font-size: 22px;
    color: #222;
}

.logout-modal-box p {
    margin: 0;

    color: #666;
    font-size: 15px;

    line-height: 1.8;
}

.logout-modal-actions {
    display: flex;

    gap: 12px;

    margin-top: 25px;
}

.logout-modal-actions button {
    flex: 1;

    height: 45px;

    border-radius: 10px;

    font-family: inherit;
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition: 0.2s;
}

.logout-cancel {
    border: 1px solid #ddd;
    background: #f7f7f7;
    color: #444;
}

.logout-cancel:hover {
    background: #eeeeee;
}

.logout-confirm {
    border: none;

    background: var(--purple-1);
    color: white;
}

.logout-confirm:hover {
    background: #4A2FB0;
}

.change-phonenumber{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1.5px solid var(--line);
  border-radius:100px;
  padding:11px 20px;
  font-weight:600;
  font-size:0.92rem;
  color:var(--purple-2);
  transition:background .2s, border-color .2s;
}

.change-phonenumber:hover{
  background:var(--surface-alt);
  border-color:var(--purple-1);
  color:var(--purple-1);
}

/* Jalali birth-date field (single input -> popup calendar), driven by jalali-date.js */

.jalali-date-field{
  margin-bottom:16px;
  position:relative;
}

.jalali-date-field label{
  display:block;
  font-size:0.9rem;
  font-weight:600;
  margin-bottom:6px;
}

.jalali-date-display{
  width:100%;
  cursor:pointer;
  background:var(--bg);
}

.jalali-calendar{
  position:absolute;
  top:calc(100% + 6px);
  right:0;
  left:0;
  z-index:20;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:14px;
  box-shadow:var(--shadow-soft);
  padding:12px;
}

.jalali-cal-header{
  display:flex;
  align-items:center;
  gap:6px;
  margin-bottom:10px;
}

.jalali-cal-nav{
  border:1px solid var(--line);
  background:var(--bg);
  border-radius:8px;
  width:30px;
  height:30px;
  font-size:1rem;
  line-height:1;
  cursor:pointer;
}

.jalali-cal-nav:hover{
  background:var(--surface-alt);
}

.jalali-cal-month-select,
.jalali-cal-year-select{
  flex:1;
  padding:6px 8px;
  border-radius:8px;
  border:1px solid var(--line);
  font-size:0.85rem;
}

.jalali-cal-weekdays{
  display:grid;
  grid-template-columns:repeat(7, 1fr);
  gap:4px;
  margin-bottom:4px;
  text-align:center;
  font-size:0.78rem;
  color:var(--ink-muted);
  font-weight:600;
}

.jalali-cal-grid{
  display:grid;
  grid-template-columns:repeat(7, 1fr);
  gap:4px;
}

.jalali-cal-day,
.jalali-cal-blank{
  aspect-ratio:1/1;
  border:none;
  background:transparent;
  border-radius:8px;
  font-size:0.85rem;
  cursor:pointer;
}

.jalali-cal-day:hover{
  background:var(--surface-alt);
}

.jalali-cal-day.is-selected{
  background:var(--gradient-brand);
  color:#fff;
  font-weight:700;
}

.jalali-cal-footer{
  display:flex;
  justify-content:flex-end;
  margin-top:8px;
  padding-top:8px;
  border-top:1px solid var(--line);
}

.jalali-cal-clear{
  background:none;
  border:none;
  color:var(--purple-1);
  font-size:0.82rem;
  font-weight:600;
  cursor:pointer;
}

.jalali-cal-clear:hover{
  text-decoration:underline;
}

@media (max-width:480px){
  .profile-banner{padding:28px 20px 50px;}
  .profile-info{padding:24px 20px 4px;}
  .profile-actions{
    padding:20px 20px 26px;
    flex-direction:column;
  }

  .profile-actions-group{
    flex-direction:column;
    align-items:center;
    width:100%;
  }

  .profile-actions .btn-primary{
    width:100%;
    max-width:280px;
  }

  .profile-btn-logout{
  position:relative;
  top:0;
  display:flex;
  align-items:center;
  justify-content:center;
  }
  
}