/* Scoped styles for Course Registration Portal modal (premium theme) */
.crp {
  --primary: #ff2a2a;
  --primary-dark: #8b0000;
  --secondary: #1a1a1a;
  --accent: #ff4d4d;
  --text: #f0f0f0;
  --text-secondary: #ccc;
  --bg-dark: #0a0a0a;
}

.crp .modal-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
  padding: 20px;
  backdrop-filter: blur(15px);
}

.crp .modal-container.active { opacity: 1; visibility: visible; }

.crp .registration-modal {
  width: 90%;
  max-width: 1100px;
  height: 85vh;
  background: var(--secondary);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(139, 0, 0, 0.4);
  overflow: hidden;
  display: flex;
  transform: translateY(80px) scale(0.9) rotateX(5deg);
  opacity: 0;
  transition: all 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.crp .modal-container.active .registration-modal { transform: translateY(0) scale(1) rotateX(0); opacity: 1; }

.crp .payment-column {
  flex: 1;
  background: linear-gradient(135deg, var(--bg-dark), #330000);
  color: var(--text);
  padding: 40px;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* scroll handled by inner wrapper */
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  min-height: 0; /* allow flex child to shrink for scrolling */
  -webkit-overflow-scrolling: touch;
  max-height: 100%;
  overscroll-behavior: contain;
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: var(--primary) rgba(255,255,255,0.05); /* Firefox */
  scrollbar-gutter: stable both-edges; /* Reserve space for scrollbar */
}
.crp .payment-column::before { content: ""; position: absolute; inset: 0; background: linear-gradient(45deg, transparent 30%, rgba(139,0,0,0.05) 50%, transparent 70%); opacity: 0; transition: opacity .8s ease; pointer-events: none; }
.crp .payment-column:hover::before { opacity: 1; }
.crp .payment-column::-webkit-scrollbar { width: 8px; }
.crp .payment-column::-webkit-scrollbar-thumb { background: linear-gradient(to bottom, var(--primary-dark), var(--primary)); border-radius: 10px; }
.crp .payment-column::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }

.crp .form-column {
  flex: 1;
  padding: 40px;
  background: var(--secondary);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  color: var(--text);
  min-height: 0; /* allow flex child to shrink for scrolling */
  -webkit-overflow-scrolling: touch;
  max-height: 100%;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) rgba(255,255,255,0.05);
  scrollbar-gutter: stable both-edges;
}
.crp .form-column::-webkit-scrollbar { width: 8px; }
.crp .form-column::-webkit-scrollbar-thumb { background: linear-gradient(to bottom, var(--primary-dark), var(--primary)); border-radius: 10px; }
.crp .form-column::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }

.crp .payment-header { margin-bottom: 40px; text-align: center; opacity: 0; transform: translateX(-30px); transition: all .6s ease .2s; }
.crp .modal-container.active .payment-header { opacity: 1; transform: translateX(0); }
.crp .payment-header h2 { font-size: 32px; margin-bottom: 15px; font-weight: 700; color: var(--primary); position: relative; display: inline-block; }
.crp .payment-header h2::after { content: ""; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); width: 60px; height: 3px; background: var(--primary); border-radius: 2px; }
.crp .payment-header p { font-size: 16px; opacity: .8; }

.crp .payment-instructions,
.crp .bank-details { background: rgba(139,0,0,0.2); padding: 25px; border-radius: 12px; margin-bottom: 30px; border: 1px solid rgba(255,255,255,0.1); position: relative; overflow: hidden; opacity: 0; transform: translateX(-30px); transition: all .6s ease; }
.crp .modal-container.active .payment-instructions { opacity: 1; transform: translateX(0); transition-delay: .4s; }
.crp .modal-container.active .bank-details { opacity: 1; transform: translateX(0); transition-delay: .6s; }
.crp .payment-instructions::before, .crp .bank-details::before { content: ""; position: absolute; top: 0; left: 0; width: 5px; height: 100%; background: var(--primary); }
.crp .payment-instructions h3, .crp .bank-details h3 { font-size: 22px; margin-bottom: 15px; display: flex; align-items: center; gap: 12px; color: var(--accent); }
.crp .payment-instructions p { font-size: 16px; line-height: 1.7; margin-bottom: 15px; }

.crp .detail-item { display: flex; justify-content: space-between; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.1); transition: all .3s ease; }
.crp .detail-item:hover { background: rgba(255,255,255,0.05); padding: 10px; border-radius: 8px; transform: translateX(5px); }
.crp .detail-label { font-weight: 600; color: var(--text-secondary); }
.crp .detail-value { text-align: right; color: var(--text); font-weight: 500; }

.crp .getting-place { text-align: center; margin-top: auto; padding-top: 25px; font-style: italic; opacity: 0.7; color: var(--accent); border-top: 1px solid rgba(255,255,255,0.1); opacity: 0; transform: translateY(30px); transition: all .6s ease .8s; font-size: 18px; font-weight: 500; }
.crp .modal-container.active .getting-place { opacity: 1; transform: translateY(0); }

.crp .form-header { margin-bottom: 40px; text-align: center; opacity: 0; transform: translateX(30px); transition: all .6s ease .2s; }
.crp .modal-container.active .form-header { opacity: 1; transform: translateX(0); }
.crp .form-header h2 { font-size: 32px; color: var(--primary); margin-bottom: 15px; font-weight: 700; position: relative; display: inline-block; }
.crp .form-header h2::after { content: ""; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); width: 60px; height: 3px; background: var(--primary); border-radius: 2px; }
.crp .form-header p { color: var(--text-secondary); }

.crp .form-group { margin-bottom: 25px; text-align: left; opacity: 0; transform: translateX(30px); transition: all .6s ease; }
.crp .modal-container.active .form-group { opacity: 1; transform: translateX(0); }
.crp .form-group:nth-child(1) { transition-delay: .3s; }
.crp .form-group:nth-child(2) { transition-delay: .4s; }
.crp .form-group:nth-child(3) { transition-delay: .5s; }
.crp .form-group:nth-child(4) { transition-delay: .6s; }
.crp .form-group:nth-child(5) { transition-delay: .7s; }
.crp .form-group label { display: block; margin-bottom: 10px; font-weight: 600; color: var(--text-secondary); font-size: 16px; transition: all .3s ease; }

.crp .form-control { width: 100%; padding: 16px 20px; background: var(--bg-dark); border: 2px solid rgba(255,255,255,0.1); border-radius: 10px; font-size: 16px; transition: all .4s ease; color: var(--text); box-shadow: inset 0 2px 5px rgba(0,0,0,0.2); }
.crp .form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(139,0,0,0.2), inset 0 2px 5px rgba(0,0,0,0.2); outline: none; transform: translateY(-3px); }
.crp .form-control::placeholder { color: #666; }

.crp .name-group { display: flex; gap: 20px; }
.crp .name-group .form-group { flex: 1; }

.crp .file-upload { position: relative; margin-top: 10px; }
.crp .file-upload input { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.crp .file-upload-label { display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: var(--bg-dark); border: 2px dashed rgba(255,255,255,0.2); border-radius: 10px; color: #666; font-size: 16px; transition: all .4s ease; box-shadow: inset 0 2px 5px rgba(0,0,0,0.2); }
.crp .file-upload-label:hover { background: #111; border-color: var(--primary); color: var(--text-secondary); transform: translateY(-2px); }

.crp .form-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 40px; opacity: 0; transform: translateY(30px); transition: all .6s ease .8s; }
.crp .modal-container.active .form-footer { opacity: 1; transform: translateY(0); }

.crp .btn { padding: 14px 30px; border: none; border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all .4s cubic-bezier(0.175,0.885,0.32,1.275); position: relative; overflow: hidden; text-transform: uppercase; letter-spacing: 1px; }
.crp .btn::before { content: ""; position: absolute; top: 50%; left: 50%; width: 0; height: 0; border-radius: 50%; background: rgba(255,255,255,0.1); transform: translate(-50%, -50%); transition: width .6s, height .6s; }
.crp .btn:hover::before { width: 300px; height: 300px; }
.crp .btn-primary { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: white; box-shadow: 0 8px 20px rgba(139,0,0,0.4); }
.crp .btn-primary:hover { transform: translateY(-5px) scale(1.05); box-shadow: 0 12px 25px rgba(255,0,0,0.6); background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.crp .btn-secondary { background: transparent; color: var(--text-secondary); border: 1px solid rgba(255,255,255,0.2); }
.crp .btn-secondary:hover { color: #fff; border-color: rgba(255,255,255,0.4); transform: translateY(-3px); }

.crp .close-btn { position: absolute; top: 25px; right: 25px; background: rgba(139, 0, 0, 0.3); width: 45px; height: 45px; border-radius: 50%; display: flex; justify-content: center; align-items: center; color: var(--accent); font-size: 22px; cursor: pointer; transition: all .4s cubic-bezier(0.175,0.885,0.32,1.275); z-index: 10; border: 1px solid rgba(255,255,255,0.1); backdrop-filter: blur(5px); }
.crp .close-btn:hover { background: rgba(139, 0, 0, 0.5); transform: rotate(90deg) scale(1.1); color: #ff6666; box-shadow: 0 5px 15px rgba(139,0,0,0.4); }

/* Success Overlay */
.crp .success-animation { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 3000; justify-content: center; align-items: center; flex-direction: column; color: #fff; backdrop-filter: blur(15px); }
.crp .success-animation.active { display: flex; animation: crp-fadeIn .5s ease; }
.crp .success-content { text-align: center; z-index: 10; opacity: 0; transform: translateY(30px); transition: all .8s ease .5s; }
.crp .success-animation.active .success-content { opacity: 1; transform: translateY(0); }
.crp .success-checkmark { width: 100px; height: 100px; margin: 0 auto 30px; position: relative; }
.crp .check-icon { width: 100px; height: 100px; position: relative; border-radius: 50%; box-sizing: content-box; border: 5px solid #4CAF50; opacity: 0; transform: scale(.5); animation: crp-check-appear .5s ease .5s forwards; }
.crp .check-icon::before, .crp .check-icon::after { content: ""; height: 100px; position: absolute; background: var(--secondary); transform: rotate(-45deg); }
.crp .check-icon::before { top: 3px; left: -2px; width: 30px; transform-origin: 100% 50%; border-radius: 100px 0 0 100px; }
.crp .check-icon::after { top: 0; left: 30px; width: 60px; transform-origin: 0 50%; border-radius: 0 100px 100px 0; animation: crp-rotate-circle 4.25s ease-in; }
.crp .icon-line { height: 6px; background-color: #4CAF50; display: block; border-radius: 2px; position: absolute; z-index: 10; }
.crp .icon-line.line-tip { top: 52px; left: 18px; width: 30px; transform: rotate(45deg); animation: crp-icon-line-tip .75s; }
.crp .icon-line.line-long { top: 42px; right: 10px; width: 55px; transform: rotate(-45deg); animation: crp-icon-line-long .75s; }
.crp .icon-circle { top: -5px; left: -5px; z-index: 10; width: 100px; height: 100px; border-radius: 50%; position: absolute; box-sizing: content-box; border: 5px solid rgba(76,175,80,0.5); }
.crp .icon-fix { top: 10px; width: 5px; left: 32px; z-index: 1; height: 90px; position: absolute; transform: rotate(-45deg); background-color: var(--secondary); }
.crp .success-content h2 { font-size: 36px; margin-bottom: 15px; color: #4CAF50; font-weight: 700; }
.crp .success-content p { font-size: 18px; color: var(--text-secondary); max-width: 500px; line-height: 1.6; }
.crp .confetti { position: absolute; width: 10px; height: 10px; background: var(--primary); opacity: 0; }

@keyframes crp-check-appear { to { opacity: 1; transform: scale(1); } }
@keyframes crp-rotate-circle { 0% { transform: rotate(-45deg); } 5% { transform: rotate(-45deg); } 12% { transform: rotate(-405deg); } 100% { transform: rotate(-405deg);} }
@keyframes crp-icon-line-tip { 0% { width: 0; left: 1px; top: 24px; } 54% { width: 0; left: 1px; top: 24px; } 70% { width: 60px; left: -10px; top: 42px; } 84% { width: 20px; left: 26px; top: 54px; } 100% { width: 30px; left: 18px; top: 52px; } }
@keyframes crp-icon-line-long { 0% { width: 0; right: 56px; top: 60px; } 65% { width: 0; right: 56px; top: 60px; } 84% { width: 65px; right: 0; top: 40px; } 100% { width: 55px; right: 10px; top: 42px; } }
@keyframes crp-fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Responsive */
@media (max-width: 768px) {
  .crp .registration-modal { flex-direction: column; height: 90vh; }
  .crp .payment-column, .crp .form-column { padding: 25px; max-height: 50vh; }
  .crp .name-group { flex-direction: column; gap: 0; }
}
.crp .payment-scroll {
  overflow-y: auto;
  min-height: 0;
  max-height: 100%;
  -webkit-overflow-scrolling: touch;
  padding-right: 6px; /* keep content from touching scrollbar */
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: var(--primary) rgba(255,255,255,0.05); /* Firefox */
}
.crp .payment-scroll::-webkit-scrollbar { width: 8px; }
.crp .payment-scroll::-webkit-scrollbar-thumb { background: linear-gradient(to bottom, var(--primary-dark), var(--primary)); border-radius: 10px; }
.crp .payment-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
